/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'central';
  @endpointMap = {
    'ap-northeast-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'ap-south-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'ap-southeast-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'ap-southeast-2' = 'cdn.ap-southeast-1.aliyuncs.com',
    'ap-southeast-3' = 'cdn.ap-southeast-1.aliyuncs.com',
    'ap-southeast-5' = 'cdn.ap-southeast-1.aliyuncs.com',
    'eu-central-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'eu-west-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'me-east-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'us-east-1' = 'cdn.ap-southeast-1.aliyuncs.com',
    'us-west-1' = 'cdn.ap-southeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('cdn', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddCdnDomainRequest {
  cdnType?: string(name='CdnType', description='The workload type of the accelerated domain name. Valid values:

*   **web**: images and small files
*   **download**: large files
*   **video**: on-demand video and audio streaming

This parameter is required.', example='web'),
  checkUrl?: string(name='CheckUrl', description='The URL that is used to check the accessibility of the origin server.', example='www.example.com/test.html'),
  domainName?: string(name='DomainName', description='The domain name that you want to add to Alibaba Cloud CDN.

A wildcard domain that starts with a period (.) is supported, such as .example.com.

This parameter is required.', example='.example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.

If you do not set this parameter, the system uses the ID of the default resource group.', example='rg-acfmyuji4b6r4**'),
  scope?: string(name='Scope', description='The acceleration region. Default value: domestic. Valid values:

*   **domestic**: Chinese mainland
*   **overseas**: global (excluding the Chinese mainland)
*   **global**: global', example='domestic'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The information about the addresses of origin servers.

This parameter is required.', example='[
      {
            "content": "192.0.2.0",
            "type": "ipaddr",
            "priority": "20",
            "port": 80,
            "weight": "15"
      }
]'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. Valid values of N: **1 to 20**.', example='env'),
      value?: string(name='Value', description='The value of the tag. Valid values of N: **1 to 20**.', example='value'),
    }
  ](name='Tag', description='Details about the tags. You can specify up to 20 tags.'),
  topLevelDomain?: string(name='TopLevelDomain', description='The top-level domain.', example='example.com'),
}

model AddCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model AddCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddCdnDomainResponseBody(name='body'),
}

/**
 * @summary Adds a domain name to accelerate.
 *
 * @description *   You must activate Alibaba Cloud CDN before you can add a domain name to it. For more information, see [Activate Alibaba Cloud CDN](https://help.aliyun.com/document_detail/27272.html).
 * *   The domain name that you want to add has a valid Internet Content Provider (ICP) number.
 * *   You can add only one domain name to Alibaba Cloud CDN in each call. Each Alibaba Cloud account can add a maximum of 50 domain names to Alibaba Cloud CDN.
 * *   If the content of the origin server is not stored on Alibaba Cloud, the content must be reviewed. The review will be completed by the end of the next business day after you submit the application.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request AddCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddCdnDomainResponse
 */
async function addCdnDomainWithOptions(request: AddCdnDomainRequest, runtime: $RuntimeOptions): AddCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cdnType)) {
    query['CdnType'] = request.cdnType;
  }
  if (!$isNull(request.checkUrl)) {
    query['CheckUrl'] = request.checkUrl;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds a domain name to accelerate.
 *
 * @description *   You must activate Alibaba Cloud CDN before you can add a domain name to it. For more information, see [Activate Alibaba Cloud CDN](https://help.aliyun.com/document_detail/27272.html).
 * *   The domain name that you want to add has a valid Internet Content Provider (ICP) number.
 * *   You can add only one domain name to Alibaba Cloud CDN in each call. Each Alibaba Cloud account can add a maximum of 50 domain names to Alibaba Cloud CDN.
 * *   If the content of the origin server is not stored on Alibaba Cloud, the content must be reviewed. The review will be completed by the end of the next business day after you submit the application.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request AddCdnDomainRequest
 * @return AddCdnDomainResponse
 */
async function addCdnDomain(request: AddCdnDomainRequest): AddCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return addCdnDomainWithOptions(request, runtime);
}

model AddFCTriggerRequest {
  eventMetaName?: string(name='EventMetaName', description='The name of the event.

This parameter is required.', example='LogFileCreated'),
  eventMetaVersion?: string(name='EventMetaVersion', description='The version of the event.

This parameter is required.', example='1.0.0'),
  functionARN?: string(name='FunctionARN', description='The feature trigger.', example='acs:fc:1223455566666:123:services/myservice/functions/myfunction'),
  notes?: string(name='Notes', description='The remarks.

This parameter is required.', example='test'),
  roleARN?: string(name='RoleARN', description='The assigned Resource Access Management (RAM) role.

This parameter is required.', example='acs:ram:: 1234567890:role/aliyuncdneventnotificationrole'),
  sourceARN?: string(name='SourceARN', description='The resources and filters for event listening.

This parameter is required.', example='acs:cdn:*:1234567890:domain/example.com'),
  triggerARN?: string(name='TriggerARN', description='The trigger that corresponds to the Function Compute service.

This parameter is required.', example='acs:fc:cn-beijing: 1234567890:services/FCTestService/functions/printEvent/triggers/testtrigger'),
}

model AddFCTriggerResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EC046C5D-8CB4-4B6B-B7F8-B335E51EF90'),
}

model AddFCTriggerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddFCTriggerResponseBody(name='body'),
}

/**
 * @summary Adds a Function Compute trigger.
 *
 * @param request AddFCTriggerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddFCTriggerResponse
 */
async function addFCTriggerWithOptions(request: AddFCTriggerRequest, runtime: $RuntimeOptions): AddFCTriggerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.triggerARN)) {
    query['TriggerARN'] = request.triggerARN;
  }
  var body : map[string]any = {};
  if (!$isNull(request.eventMetaName)) {
    body['EventMetaName'] = request.eventMetaName;
  }
  if (!$isNull(request.eventMetaVersion)) {
    body['EventMetaVersion'] = request.eventMetaVersion;
  }
  if (!$isNull(request.functionARN)) {
    body['FunctionARN'] = request.functionARN;
  }
  if (!$isNull(request.notes)) {
    body['Notes'] = request.notes;
  }
  if (!$isNull(request.roleARN)) {
    body['RoleARN'] = request.roleARN;
  }
  if (!$isNull(request.sourceARN)) {
    body['SourceARN'] = request.sourceARN;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddFCTrigger',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds a Function Compute trigger.
 *
 * @param request AddFCTriggerRequest
 * @return AddFCTriggerResponse
 */
async function addFCTrigger(request: AddFCTriggerRequest): AddFCTriggerResponse {
  var runtime = new $RuntimeOptions{};
  return addFCTriggerWithOptions(request, runtime);
}

model BatchAddCdnDomainRequest {
  cdnType?: string(name='CdnType', description='The workload type of the domain name to accelerate. Valid values:

*   **web**: images and small files
*   **download**: large files
*   **video**: on-demand video and audio streaming

This parameter is required.', example='web'),
  checkUrl?: string(name='CheckUrl', description='The URL that is used for health checks.', example='url'),
  domainName?: string(name='DomainName', description='The domain names that you want to add to Alibaba Cloud CDN. Separate domain names with commas (,).

This parameter is required.', example='example.com,aliyundoc.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. If you do not specify a value for this parameter, the system uses the ID of the default resource group.', example='rg-acfmyuji4b6r4**'),
  scope?: string(name='Scope', description='The acceleration region. Default value: domestic. Valid values:

*   **domestic**: Chinese mainland
*   **overseas**: global (excluding the Chinese mainland)
*   **global**: global', example='domestic'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The information about the addresses of origin servers.

This parameter is required.', example='[
      {
            "content": "192.0.2.0",
            "type": "ipaddr",
            "priority": "20",
            "port": 80,
            "weight": "15"
      }
]'),
  topLevelDomain?: string(name='TopLevelDomain', description='The top-level domain.', example='example.com'),
}

model BatchAddCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model BatchAddCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchAddCdnDomainResponseBody(name='body'),
}

/**
 * @summary Adds one or more domain names to Alibaba Cloud CDN. You can add a maximum of 50 domain names at a time.
 *
 * @description *   You must activate Alibaba Cloud CDN before you can add a domain name to it. For more information, see [Activate Alibaba Cloud CDN](https://help.aliyun.com/document_detail/27272.html).
 * *   If the acceleration region is Chinese Mainland Only or Global, you must apply for an ICP filing for the domain name.
 * *   You can specify multiple domain names and separate them with commas (,). You can specify at most 50 domain names in each call.
 * *   For more information, see [Add a domain name](https://help.aliyun.com/document_detail/122181.html).
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request BatchAddCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchAddCdnDomainResponse
 */
async function batchAddCdnDomainWithOptions(request: BatchAddCdnDomainRequest, runtime: $RuntimeOptions): BatchAddCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cdnType)) {
    query['CdnType'] = request.cdnType;
  }
  if (!$isNull(request.checkUrl)) {
    query['CheckUrl'] = request.checkUrl;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!$isNull(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchAddCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds one or more domain names to Alibaba Cloud CDN. You can add a maximum of 50 domain names at a time.
 *
 * @description *   You must activate Alibaba Cloud CDN before you can add a domain name to it. For more information, see [Activate Alibaba Cloud CDN](https://help.aliyun.com/document_detail/27272.html).
 * *   If the acceleration region is Chinese Mainland Only or Global, you must apply for an ICP filing for the domain name.
 * *   You can specify multiple domain names and separate them with commas (,). You can specify at most 50 domain names in each call.
 * *   For more information, see [Add a domain name](https://help.aliyun.com/document_detail/122181.html).
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request BatchAddCdnDomainRequest
 * @return BatchAddCdnDomainResponse
 */
async function batchAddCdnDomain(request: BatchAddCdnDomainRequest): BatchAddCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return batchAddCdnDomainWithOptions(request, runtime);
}

model BatchDeleteCdnDomainConfigRequest {
  domainNames?: string(name='DomainNames', description='The accelerated domain names whose configurations you want to delete. Separate multiple accelerated domain names with commas (,).

This parameter is required.', example='example.com,example.org'),
  functionNames?: string(name='FunctionNames', description='The names of the features that you want to delete. Separate multiple feature names with commas (,). For more information about feature names, see [Parameters for configuring features for domain names](https://help.aliyun.com/document_detail/388460.html).

This parameter is required.', example='referer_white_list_set,https_force'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchDeleteCdnDomainConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model BatchDeleteCdnDomainConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDeleteCdnDomainConfigResponseBody(name='body'),
}

/**
 * @summary Deletes configurations of multiple accelerated domain names at a time.
 *
 * @description *   You can specify up to 50 domain names in each request.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request BatchDeleteCdnDomainConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDeleteCdnDomainConfigResponse
 */
async function batchDeleteCdnDomainConfigWithOptions(request: BatchDeleteCdnDomainConfigRequest, runtime: $RuntimeOptions): BatchDeleteCdnDomainConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.functionNames)) {
    query['FunctionNames'] = request.functionNames;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchDeleteCdnDomainConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes configurations of multiple accelerated domain names at a time.
 *
 * @description *   You can specify up to 50 domain names in each request.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request BatchDeleteCdnDomainConfigRequest
 * @return BatchDeleteCdnDomainConfigResponse
 */
async function batchDeleteCdnDomainConfig(request: BatchDeleteCdnDomainConfigRequest): BatchDeleteCdnDomainConfigResponse {
  var runtime = new $RuntimeOptions{};
  return batchDeleteCdnDomainConfigWithOptions(request, runtime);
}

model BatchDescribeCdnIpInfoRequest {
  ipAddrList?: string(name='IpAddrList', description='The list of IP addresses to query. Separate IP addresses with commas (,). You can specify up to 20 IP addresses at a time.

> *   Example of an IPv4 address: 192.0.2.1
>*   Example of an IPv6 address: 2001:db8:ffff:ffff:ffff:\\\\*\\\\*\\\\*\\\\*:ffff.

This parameter is required.', example='111.XXX.XXX.230,47.XXX.XXX.243'),
  language?: string(name='Language', description='The language of the query results. Valid values:

*   **zh** (default): Simplified Chinese.
*   **en**: English.', example='en'),
}

model BatchDescribeCdnIpInfoResponseBody = {
  ipInfoList?: [ 
    {
      cdnIp?: string(name='CdnIp', description='Indicates whether the IP address belongs to an Alibaba Cloud CDN point of presence (POP).

*   **true**
*   **false**', example='true'),
      city?: string(name='City', description='The city to which the IP address belongs.', example='Beijing'),
      country?: string(name='Country', description='The country to which the IP address belongs.', example='China'),
      ipAddress?: string(name='IpAddress', description='The IP address.', example='111.XXX.XXX.230'),
      ispName?: string(name='IspName', description='The ISP to which the IP address belongs.', example='Move'),
      province?: string(name='Province', description='The province to which the IP address belongs.', example='Beijing'),
    }
  ](name='IpInfoList', description='The results about IP addresses returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='55ADD936-763F-5E1A-BF54-2EA3F6E94A52'),
}

model BatchDescribeCdnIpInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDescribeCdnIpInfoResponseBody(name='body'),
}

/**
 * @summary Queries whether one or more IP addresses are assigned to Alibaba Cloud CDN.
 *
 * @description >The maximum number of times that each user can call this operation per second is 20.
 *
 * @param request BatchDescribeCdnIpInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDescribeCdnIpInfoResponse
 */
async function batchDescribeCdnIpInfoWithOptions(request: BatchDescribeCdnIpInfoRequest, runtime: $RuntimeOptions): BatchDescribeCdnIpInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ipAddrList)) {
    query['IpAddrList'] = request.ipAddrList;
  }
  if (!$isNull(request.language)) {
    query['Language'] = request.language;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchDescribeCdnIpInfo',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether one or more IP addresses are assigned to Alibaba Cloud CDN.
 *
 * @description >The maximum number of times that each user can call this operation per second is 20.
 *
 * @param request BatchDescribeCdnIpInfoRequest
 * @return BatchDescribeCdnIpInfoResponse
 */
async function batchDescribeCdnIpInfo(request: BatchDescribeCdnIpInfoRequest): BatchDescribeCdnIpInfoResponse {
  var runtime = new $RuntimeOptions{};
  return batchDescribeCdnIpInfoWithOptions(request, runtime);
}

model BatchSetCdnDomainConfigRequest {
  domainNames?: string(name='DomainNames', description='The accelerated domain names. You can specify multiple accelerated domain names and separate them with commas (,).

This parameter is required.', example='www.example.com'),
  functions?: string(name='Functions', description='The features that you want to configure. Format:

*   **functionName**: the name of the feature. This parameter is required. Separate multiple values with commas (,). For more information, see [Parameters for configuring features for domain names](https://help.aliyun.com/document_detail/388460.html).
*   **argName**: the feature parameter for **functionName**. This parameter is required. You can specify multiple feature parameters.
*   **argValue**: the parameter value that is specified for **functionName**. This parameter is required.
*   **parentid**: the rule condition ID. This parameter is optional. You can use the **condition** rule engine to create a rule condition. For information, see [Parameters for configuring features for domain names](https://help.aliyun.com/document_detail/388460.html). A rule condition can identify parameters that are included in requests and filter requests based on the identified parameters. After you create a rule condition, a [configid](https://help.aliyun.com/document_detail/388994.html) is generated. A configid can be used as parentId that is referenced by other features. This way, you can combine rule conditions and features for flexible configurations.

If the **ParentId** parameter is \\\\*\\\\*-1\\\\*\\\\*, the existing rule conditions in the configurations are deleted.

```[{
   "functionArgs": [{
     "argName": "Parameter A", 
     "argValue": "Value of parameter A"
    }, 
  {
    "argName": "Parameter B", 
    "argValue": "Value of parameter B"
     }], 
 "functionName": "Feature name"
 "parentId": Optional. parentId corresponds to configid of the referenced rule condition
}]
```

The following code provides a sample configuration if **parentId** is not used. In this example, the **origin_request_header** feature is used to add back-to-origin HTTP headers, and the rule condition whose configuration ID is **configid=222728944812032** is referenced.

```[{
        "functionArgs": [{
            "argName": "header_operation_type",
            "argValue": "add"
        }, {
            "argName": "header_name",
            "argValue": "Accept-Encoding"
        }, {
            "argName": "header_value",
            "argValue": "gzip"
        }, {
            "argName": "duplicate",
            "argValue": "off"
        }],
        "functionName": "origin_request_header"
}]
```

The following code shows a sample configuration if **parentId** is used. In this example, the **origin_request_header** feature is used to add back-to-origin HTTP headers, and the rule condition whose configuration ID is **222728944812032** is referenced.

```[{
        "functionArgs": [{
            "argName": "header_operation_type",
            "argValue": "add"
        }, {
            "argName": "header_name",
            "argValue": "Accept-Encoding"
        }, {
            "argName": "header_value",
            "argValue": "gzip"
        }, {
            "argName": "duplicate",
            "argValue": "off"
        }],
        "functionName": "origin_request_header",
        "parentId": 222728944812032
}]
```

The following code provides a sample configuration that deletes the reference to **parentId** for a feature that uses **parentId**. This example shows how to delete the rule condition that has a configuration ID of **222728944812032** and is referenced when **origin_request_header** feature is used to add back-to-origin HTTP headers.

```[{
        "functionArgs": [{
            "argName": "header_operation_type",
            "argValue": "add"
        }, {
            "argName": "header_name",
            "argValue": "Accept-Encoding"
        }, {
            "argName": "header_value",
            "argValue": "gzip"
        }, {
            "argName": "duplicate",
            "argValue": "off"
        }],
        "functionName": "origin_request_header",
        "parentId": -1
}]
```

This parameter is required.', example='[{"functionArgs": [{"argName": "key","argValue": "Content-Encoding"},{"argName": "value","argValue": "gzip"}],"functionName": "set_resp_header"} ]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchSetCdnDomainConfigResponseBody = {
  domainConfigList?: {
    domainConfigModel?: [ 
    {
      configId?: long(name='ConfigId', description='The ID of the configuration.', example='1234567'),
      domainName?: string(name='DomainName', description='The domain name.', example='www.example.com'),
      functionName?: string(name='FunctionName', description='The name of the feature.', example='set_resp_header'),
    }
  ](name='DomainConfigModel')
  }(name='DomainConfigList', description='The list of domain configurations.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model BatchSetCdnDomainConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchSetCdnDomainConfigResponseBody(name='body'),
}

/**
 * @summary Configures multiple accelerated domain names at a time.
 *
 * @description *   You can call this operation up to 30 times per second per account.
 * *   You can specify multiple domain names and must separate them with commas (,). You can specify up to 50 domain names in each call.
 * *   If the BatchSetCdnDomainConfig operation is successful, a unique configuration ID (ConfigId) is generated. You can use configuration IDs to update or delete configurations. For more information, see [Usage notes on ConfigId](https://help.aliyun.com/document_detail/388994.html).
 *
 * @param request BatchSetCdnDomainConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchSetCdnDomainConfigResponse
 */
async function batchSetCdnDomainConfigWithOptions(request: BatchSetCdnDomainConfigRequest, runtime: $RuntimeOptions): BatchSetCdnDomainConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.functions)) {
    query['Functions'] = request.functions;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchSetCdnDomainConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Configures multiple accelerated domain names at a time.
 *
 * @description *   You can call this operation up to 30 times per second per account.
 * *   You can specify multiple domain names and must separate them with commas (,). You can specify up to 50 domain names in each call.
 * *   If the BatchSetCdnDomainConfig operation is successful, a unique configuration ID (ConfigId) is generated. You can use configuration IDs to update or delete configurations. For more information, see [Usage notes on ConfigId](https://help.aliyun.com/document_detail/388994.html).
 *
 * @param request BatchSetCdnDomainConfigRequest
 * @return BatchSetCdnDomainConfigResponse
 */
async function batchSetCdnDomainConfig(request: BatchSetCdnDomainConfigRequest): BatchSetCdnDomainConfigResponse {
  var runtime = new $RuntimeOptions{};
  return batchSetCdnDomainConfigWithOptions(request, runtime);
}

model BatchSetGrayDomainFunctionRequest {
  configs?: string(name='Configs', description='This parameter is required.', example='[{"functionArgs": [{"argName": "key","argValue": "Content-Encoding"},{"argName": "value","argValue": "gzip"}],"functionName": "set_resp_header"} ]'),
  domainNames?: string(name='DomainNames', description='This parameter is required.', example='example.com,xxx.org.com'),
}

model BatchSetGrayDomainFunctionResponseBody = {
  domainConfigList?: [ 
    {
      configId?: long(name='ConfigId', example='1234567'),
      domainName?: string(name='DomainName', example='www.example.com'),
      functionName?: string(name='FunctionName', example='set_resp_header'),
    }
  ](name='DomainConfigList'),
  requestId?: string(name='RequestId', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
}

model BatchSetGrayDomainFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchSetGrayDomainFunctionResponseBody(name='body'),
}

/**
 * @summary 批量配置多个域名的灰度动态功能
 *
 * @param request BatchSetGrayDomainFunctionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchSetGrayDomainFunctionResponse
 */
async function batchSetGrayDomainFunctionWithOptions(request: BatchSetGrayDomainFunctionRequest, runtime: $RuntimeOptions): BatchSetGrayDomainFunctionResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.configs)) {
    body['Configs'] = request.configs;
  }
  if (!$isNull(request.domainNames)) {
    body['DomainNames'] = request.domainNames;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchSetGrayDomainFunction',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量配置多个域名的灰度动态功能
 *
 * @param request BatchSetGrayDomainFunctionRequest
 * @return BatchSetGrayDomainFunctionResponse
 */
async function batchSetGrayDomainFunction(request: BatchSetGrayDomainFunctionRequest): BatchSetGrayDomainFunctionResponse {
  var runtime = new $RuntimeOptions{};
  return batchSetGrayDomainFunctionWithOptions(request, runtime);
}

model BatchStartCdnDomainRequest {
  domainNames?: string(name='DomainNames', description='The accelerated domain names. You can specify one or more domain names. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchStartCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model BatchStartCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchStartCdnDomainResponseBody(name='body'),
}

/**
 * @summary Enables one or more domain names at a time. After a domain name is enabled, the value of the DomainStatus parameter is changed to Online.
 *
 * @description *   If a domain name specified in the request is in an invalid state or your account has an overdue payment, the domain name cannot be enabled.
 * *   You can call this operation up to 30 times per second per account.
 * *   You can specify up to 50 domain names in each request.
 *
 * @param request BatchStartCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchStartCdnDomainResponse
 */
async function batchStartCdnDomainWithOptions(request: BatchStartCdnDomainRequest, runtime: $RuntimeOptions): BatchStartCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchStartCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables one or more domain names at a time. After a domain name is enabled, the value of the DomainStatus parameter is changed to Online.
 *
 * @description *   If a domain name specified in the request is in an invalid state or your account has an overdue payment, the domain name cannot be enabled.
 * *   You can call this operation up to 30 times per second per account.
 * *   You can specify up to 50 domain names in each request.
 *
 * @param request BatchStartCdnDomainRequest
 * @return BatchStartCdnDomainResponse
 */
async function batchStartCdnDomain(request: BatchStartCdnDomainRequest): BatchStartCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return batchStartCdnDomainWithOptions(request, runtime);
}

model BatchStopCdnDomainRequest {
  domainNames?: string(name='DomainNames', description='The names of the accelerated domain names. You can specify one or more domain names in each request. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchStopCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='324AEFFF-308C-4DA7-8CD3-01B277B98F28'),
}

model BatchStopCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchStopCdnDomainResponseBody(name='body'),
}

/**
 * @summary Disables one or more accelerated domain names at a time. After an accelerated domain name is disabled, the value of the DomainStatus parameter is changed to Offline.
 *
 * @description *   After an accelerated domain name is disabled, Alibaba Cloud CDN retains its information and reroutes all the requests that are destined for the accelerated domain name to the origin.
 * *   If you need to temporarily disable CDN acceleration for a domain name, we recommend that you call the StopDomain operation.
 * *   You can call this operation up to 30 times per second per account.
 * *   You can specify up to 50 domain names in each request.
 *
 * @param request BatchStopCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchStopCdnDomainResponse
 */
async function batchStopCdnDomainWithOptions(request: BatchStopCdnDomainRequest, runtime: $RuntimeOptions): BatchStopCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchStopCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables one or more accelerated domain names at a time. After an accelerated domain name is disabled, the value of the DomainStatus parameter is changed to Offline.
 *
 * @description *   After an accelerated domain name is disabled, Alibaba Cloud CDN retains its information and reroutes all the requests that are destined for the accelerated domain name to the origin.
 * *   If you need to temporarily disable CDN acceleration for a domain name, we recommend that you call the StopDomain operation.
 * *   You can call this operation up to 30 times per second per account.
 * *   You can specify up to 50 domain names in each request.
 *
 * @param request BatchStopCdnDomainRequest
 * @return BatchStopCdnDomainResponse
 */
async function batchStopCdnDomain(request: BatchStopCdnDomainRequest): BatchStopCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return batchStopCdnDomainWithOptions(request, runtime);
}

model BatchUpdateCdnDomainRequest {
  domainName?: string(name='DomainName', description='The accelerated domain names. You can specify one or more accelerated domain names. Separate domain names with commas (,).

This parameter is required.', example='example.com,example.org'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyuji4b6r4**'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The information about the addresses of origin servers.

> Do not set **Sources** and **TopLevelDomain** at the same time. If you set **Sources** and **TopLevelDomain** at the same time, **TopLevelDomain** does not take effect.', example='[{"content":"10.10.10.10","type":"ipaddr","priority":"20","port":80,"weight":"15"}]'),
  topLevelDomain?: string(name='TopLevelDomain', description='The root domain.

> Do not set **Sources** and **TopLevelDomain** at the same time. If you set **Sources** and **TopLevelDomain** at the same time, **TopLevelDomain** does not take effect.', example='example.com'),
}

model BatchUpdateCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model BatchUpdateCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchUpdateCdnDomainResponseBody(name='body'),
}

/**
 * @summary Updates the configurations of multiple accelerated domain names at a time.
 *
 * @description *   You can call this operation up to 30 times per second per account.
 * *   You can specify up to 50 domain names in each request. Separate multiple domain names with commas (,).
 *
 * @param request BatchUpdateCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchUpdateCdnDomainResponse
 */
async function batchUpdateCdnDomainWithOptions(request: BatchUpdateCdnDomainRequest, runtime: $RuntimeOptions): BatchUpdateCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!$isNull(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchUpdateCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the configurations of multiple accelerated domain names at a time.
 *
 * @description *   You can call this operation up to 30 times per second per account.
 * *   You can specify up to 50 domain names in each request. Separate multiple domain names with commas (,).
 *
 * @param request BatchUpdateCdnDomainRequest
 * @return BatchUpdateCdnDomainResponse
 */
async function batchUpdateCdnDomain(request: BatchUpdateCdnDomainRequest): BatchUpdateCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return batchUpdateCdnDomainWithOptions(request, runtime);
}

model CdnMigrateRegisterRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name for which you want to register the dynamic routing feature. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
}

model CdnMigrateRegisterResponseBody = {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The request ID.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  status?: string(name='Status', description='The registration status. Valid values:

*   **running**
*   **succeed**
*   **failed**', example='succeed'),
}

model CdnMigrateRegisterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CdnMigrateRegisterResponseBody(name='body'),
}

/**
 * @summary Registers the dynamic routing feature of Dynamic Content Delivery Network (DCDN) for an Alibaba Cloud CDN-accelerated domain name. After the registration is successful, the routing center generates the dynamic routing information and send it to DCDN points of presence (POPs). This is a prerequisite for you to transfer a domain name from Alibaba Cloud CDN to DCDN.
 *
 * @param request CdnMigrateRegisterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CdnMigrateRegisterResponse
 */
async function cdnMigrateRegisterWithOptions(request: CdnMigrateRegisterRequest, runtime: $RuntimeOptions): CdnMigrateRegisterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CdnMigrateRegister',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Registers the dynamic routing feature of Dynamic Content Delivery Network (DCDN) for an Alibaba Cloud CDN-accelerated domain name. After the registration is successful, the routing center generates the dynamic routing information and send it to DCDN points of presence (POPs). This is a prerequisite for you to transfer a domain name from Alibaba Cloud CDN to DCDN.
 *
 * @param request CdnMigrateRegisterRequest
 * @return CdnMigrateRegisterResponse
 */
async function cdnMigrateRegister(request: CdnMigrateRegisterRequest): CdnMigrateRegisterResponse {
  var runtime = new $RuntimeOptions{};
  return cdnMigrateRegisterWithOptions(request, runtime);
}

model ChangeCdnDomainToDcdnRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  operation?: string(name='Operation', description='The operation to perform. Set the value to preCheck. Precheck is performed, and the result is returned. If the precheck passes, set the value to enforce to perform the transfer.', example='preCheck'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ChangeCdnDomainToDcdnResponseBody = {
  content?: map[string]any(name='Content', description='The content of the migration instructions.', example='{
		"The_domain_name_quota_for_the_target_account_has_reached_the_upper_limit": true,
		"Domain_name_requires_node2_architecture_to_be_enabled": true,
		"Internal_customer_domain_name_migration_prohibited": true,
		"Prohibit_the_migration_of_important_customer_domain_names": true,
		"Protected_domain_names_are_prohibited_from_migration": true,
		"Domain_names_accessed_through_TopDomain_are_prohibited_from_migration": true,
		"Prohibit_migration_of_customer_domain_names_for_integrated_access": true
	}'),
  requestId?: string(name='RequestId', description='The request ID.', example='E6172599-7DA7-5471-9D22-359A4E0C9B94'),
}

model ChangeCdnDomainToDcdnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeCdnDomainToDcdnResponseBody(name='body'),
}

/**
 * @summary Transfer a domain name from Alibaba Cloud CDN to DCDN.
 *
 * @param request ChangeCdnDomainToDcdnRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeCdnDomainToDcdnResponse
 */
async function changeCdnDomainToDcdnWithOptions(request: ChangeCdnDomainToDcdnRequest, runtime: $RuntimeOptions): ChangeCdnDomainToDcdnResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.operation)) {
    query['Operation'] = request.operation;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeCdnDomainToDcdn',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Transfer a domain name from Alibaba Cloud CDN to DCDN.
 *
 * @param request ChangeCdnDomainToDcdnRequest
 * @return ChangeCdnDomainToDcdnResponse
 */
async function changeCdnDomainToDcdn(request: ChangeCdnDomainToDcdnRequest): ChangeCdnDomainToDcdnResponse {
  var runtime = new $RuntimeOptions{};
  return changeCdnDomainToDcdnWithOptions(request, runtime);
}

model CheckCdnDomainExistRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

This parameter is required.', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CheckCdnDomainExistResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  status?: string(name='Status', description='The status of the domain name. Valid values:

*   **DomainNotExist**: The domain name is not added.
*   **DomainExistOtherUser**: The domain name has been added by another account.
*   **DomainExistCdnProduct**: The domain name has been added to Alibaba Cloud CDN.
*   **DomainExistDcdnProduct**: The domain name has been added to Dynamic Content Delivery Network (DCDN).
*   **DomainExistScdnProduct**: The domain name has been added to Secure CDN (SCDN).
*   **DomainExistVodProduct**: The domain name has been added to ApsaraVideo VOD.
*   **DomainExistLiveProduct**: The domain name has been added to ApsaraVideo Live.
*   **DomainExistDcdnipaProduct**: The domain name has been added to DCDN IP Application Accelerator (IPA).', example='DomainNotExist'),
}

model CheckCdnDomainExistResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCdnDomainExistResponseBody(name='body'),
}

/**
 * @summary Checks whether a domain name exists.
 *
 * @param request CheckCdnDomainExistRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCdnDomainExistResponse
 */
async function checkCdnDomainExistWithOptions(request: CheckCdnDomainExistRequest, runtime: $RuntimeOptions): CheckCdnDomainExistResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckCdnDomainExist',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Checks whether a domain name exists.
 *
 * @param request CheckCdnDomainExistRequest
 * @return CheckCdnDomainExistResponse
 */
async function checkCdnDomainExist(request: CheckCdnDomainExistRequest): CheckCdnDomainExistResponse {
  var runtime = new $RuntimeOptions{};
  return checkCdnDomainExistWithOptions(request, runtime);
}

model CheckCdnDomainICPRequest {
  domainName?: string(name='DomainName', description='The domain name.

This parameter is required.', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CheckCdnDomainICPResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
  status?: string(name='Status', description='The status of the resource plan. Valid value:

*   **DomainIsRegistration**: An ICP filing is obtained for the domain name.
*   **DomainNotRegistration**: No ICP filing is obtained for the domain name.', example='DomainIsRegistration'),
}

model CheckCdnDomainICPResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCdnDomainICPResponseBody(name='body'),
}

/**
 * @summary Checks whether an ICP filing is obtained for the domain name.
 *
 * @param request CheckCdnDomainICPRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCdnDomainICPResponse
 */
async function checkCdnDomainICPWithOptions(request: CheckCdnDomainICPRequest, runtime: $RuntimeOptions): CheckCdnDomainICPResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckCdnDomainICP',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Checks whether an ICP filing is obtained for the domain name.
 *
 * @param request CheckCdnDomainICPRequest
 * @return CheckCdnDomainICPResponse
 */
async function checkCdnDomainICP(request: CheckCdnDomainICPRequest): CheckCdnDomainICPResponse {
  var runtime = new $RuntimeOptions{};
  return checkCdnDomainICPWithOptions(request, runtime);
}

model CreateCdnCertificateSigningRequestRequest {
  city?: string(name='City', description='The city. Default value: Hangzhou.', example='Hangzhou'),
  commonName?: string(name='CommonName', description='The Common Name of the certificate.

This parameter is required.', example='CommonName'),
  country?: string(name='Country', description='The country or region in which the organization is located. Default value: CN.', example='CN'),
  email?: string(name='Email', description='The email address.', example='username@example.com'),
  organization?: string(name='Organization', description='The name of the organization. Default value: Alibaba Inc.', example='Alibaba Inc'),
  organizationUnit?: string(name='OrganizationUnit', description='The name of the department. Default value: Aliyun CDN.', example='Aliyun CDN'),
  SANs?: string(name='SANs', description='The Subject Alternative Name (SAN) extension of the SSL certificate. This extension is used to add domain names to the certificate. Separate multiple domain names with commas (,).', example='example.com'),
  state?: string(name='State', description='The provincial district. Default value: Zhejiang.', example='Zhejiang'),
}

model CreateCdnCertificateSigningRequestResponseBody = {
  commonName?: string(name='CommonName', description='The Common Name of the certificate.', example='CommonName'),
  csr?: string(name='Csr', description='The content of the CSR file.', example='CSRName'),
  pubMd5?: string(name='PubMd5', description='The MD5 hash value of the certificate public key.', example='629bf4fd8104eda171135bcb0f77****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model CreateCdnCertificateSigningRequestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCdnCertificateSigningRequestResponseBody(name='body'),
}

/**
 * @summary Creates a certificate signing request (CSR).
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request CreateCdnCertificateSigningRequestRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCdnCertificateSigningRequestResponse
 */
async function createCdnCertificateSigningRequestWithOptions(request: CreateCdnCertificateSigningRequestRequest, runtime: $RuntimeOptions): CreateCdnCertificateSigningRequestResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.city)) {
    query['City'] = request.city;
  }
  if (!$isNull(request.commonName)) {
    query['CommonName'] = request.commonName;
  }
  if (!$isNull(request.country)) {
    query['Country'] = request.country;
  }
  if (!$isNull(request.email)) {
    query['Email'] = request.email;
  }
  if (!$isNull(request.organization)) {
    query['Organization'] = request.organization;
  }
  if (!$isNull(request.organizationUnit)) {
    query['OrganizationUnit'] = request.organizationUnit;
  }
  if (!$isNull(request.SANs)) {
    query['SANs'] = request.SANs;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCdnCertificateSigningRequest',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a certificate signing request (CSR).
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request CreateCdnCertificateSigningRequestRequest
 * @return CreateCdnCertificateSigningRequestResponse
 */
async function createCdnCertificateSigningRequest(request: CreateCdnCertificateSigningRequestRequest): CreateCdnCertificateSigningRequestResponse {
  var runtime = new $RuntimeOptions{};
  return createCdnCertificateSigningRequestWithOptions(request, runtime);
}

model CreateCdnDeliverTaskRequest {
  deliver?: string(name='Deliver', description='The method that is used to send operations reports. Operations reports are sent to you only by email. The settings must be escaped in JSON.

This parameter is required.', example='{"email":{"subject":"the email subject","to":["username@example.com","username@example.org"]}}'),
  domainName?: string(name='DomainName', description='The domain names to be tracked. Separate multiple domain names with commas (,). You can specify up to 500 domain names. If you want to specify more than 500 domain names, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).

> If you do not specify a domain name, the tracking task is created for all domain names that belong to your Alibaba Cloud account.', example='www.example1.com,www.example2.com'),
  name?: string(name='Name', description='The name of the tracking task.

This parameter is required.', example='Domain name report'),
  reports?: string(name='Reports', description='The operations reports that are tracked by the task. The data must be escaped in JSON.

This parameter is required.', example='[{\\\\\\\\"reportId\\\\\\\\":1,\\\\\\\\"conditions\\\\\\\\":[{\\\\\\\\"field\\\\\\\\":\\\\\\\\"prov\\\\\\\\",\\\\\\\\"op\\\\\\\\":\\\\\\\\"in\\\\\\\\",\\\\\\\\"value\\\\\\\\":[\\\\\\\\"Heilongjiang\\\\\\\\",\\\\\\\\"Beijing\\\\\\\\"]}]}]'),
  schedule?: string(name='Schedule', description='The parameters that specify the time interval at which the tracking task sends operations reports. The settings must be escaped in JSON.

This parameter is required.', example='{\\\\\\\\"schedName\\\\\\\\":\\\\\\\\"The name of the tracking task\\\\\\\\",\\\\\\\\"description\\\\\\\\":\\\\\\\\"The description\\\\\\\\",\\\\\\\\"crontab\\\\\\\\":\\\\\\\\"000\\\\*\\\\*?\\\\\\\\",\\\\\\\\"frequency\\\\\\\\":\\\\\\\\"d\\\\\\\\",\\\\\\\\"status\\\\\\\\":\\\\\\\\"enable\\\\\\\\",\\\\\\\\"effectiveFrom\\\\\\\\":\\\\\\\\"2020-09-17T00:00:00Z\\\\\\\\",\\\\\\\\"effectiveEnd\\\\\\\\":\\\\\\\\"2020-11-17T00:00:00Z\\\\\\\\"}"'),
}

model CreateCdnDeliverTaskResponseBody = {
  deliverId?: string(name='DeliverId', description='The ID of the tracking task.', example='1025'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateCdnDeliverTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCdnDeliverTaskResponseBody(name='body'),
}

/**
 * @summary Creates a tracking task. After you create a tracking task, the system sends operations reports to you by email on a regular basis.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request CreateCdnDeliverTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCdnDeliverTaskResponse
 */
async function createCdnDeliverTaskWithOptions(request: CreateCdnDeliverTaskRequest, runtime: $RuntimeOptions): CreateCdnDeliverTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.deliver)) {
    body['Deliver'] = request.deliver;
  }
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.name)) {
    body['Name'] = request.name;
  }
  if (!$isNull(request.reports)) {
    body['Reports'] = request.reports;
  }
  if (!$isNull(request.schedule)) {
    body['Schedule'] = request.schedule;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCdnDeliverTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a tracking task. After you create a tracking task, the system sends operations reports to you by email on a regular basis.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request CreateCdnDeliverTaskRequest
 * @return CreateCdnDeliverTaskResponse
 */
async function createCdnDeliverTask(request: CreateCdnDeliverTaskRequest): CreateCdnDeliverTaskResponse {
  var runtime = new $RuntimeOptions{};
  return createCdnDeliverTaskWithOptions(request, runtime);
}

model CreateCdnSubTaskRequest {
  domainName?: string(name='DomainName', description='The domain names to be tracked. Separate multiple domain names with commas (,). You can specify up to 500 domain names. If you want to specify more than 500 domain names, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).

> If you do not specify a domain name, the custom operations report is created for all domain names that belong to your Alibaba Cloud account.', example='www.example1.com,www.example2.com'),
  reportIds?: string(name='ReportIds', description='The IDs of the metrics that you want to include in the report. Separate multiple IDs with commas (,). Valid values:

*   **1**: frequently requested URLs (ranked by the number of requests)
*   **3**: frequently requested URLs (ranked by the amount of network traffic)
*   **5**: frequently used Referer headers (ranked by the number of requests)
*   **7**: frequently used Referer headers (ranked by the amount of network traffic)
*   **9**: frequently requested URLs that are redirected to the origin (ranked by the number of requests)
*   **11**: frequently requested URLs that are redirected to the origin (ranked by the amount of network traffic)
*   **13**: top client IP addresses (ranked by the number of requests)
*   **15**: top client IP addresses (ranked by the amount of network traffic)
*   **17**: domain names ranked by the amount of network traffic
*   **19**: page views and unique visitors
*   **21**: regions from which requests are initiated
*   **23**: Internet service providers (ISPs)

This parameter is required.', example='1,3,5'),
}

model CreateCdnSubTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateCdnSubTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCdnSubTaskResponseBody(name='body'),
}

/**
 * @summary Creates a custom operations report.
 *
 * @description *   This operation allows you to create a custom operations report for a specific domain name. You can view the statistics about the domain name in the report.
 * *   You can call this operation up to three times per second per account.
 *
 * @param request CreateCdnSubTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCdnSubTaskResponse
 */
async function createCdnSubTaskWithOptions(request: CreateCdnSubTaskRequest, runtime: $RuntimeOptions): CreateCdnSubTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.reportIds)) {
    body['ReportIds'] = request.reportIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCdnSubTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a custom operations report.
 *
 * @description *   This operation allows you to create a custom operations report for a specific domain name. You can view the statistics about the domain name in the report.
 * *   You can call this operation up to three times per second per account.
 *
 * @param request CreateCdnSubTaskRequest
 * @return CreateCdnSubTaskResponse
 */
async function createCdnSubTask(request: CreateCdnSubTaskRequest): CreateCdnSubTaskResponse {
  var runtime = new $RuntimeOptions{};
  return createCdnSubTaskWithOptions(request, runtime);
}

model CreateRealTimeLogDeliveryRequest {
  domain?: string(name='Domain', description='The accelerated domain name for which you want to configure real-time log delivery.

This parameter is required.', example='example.com'),
  logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.

This parameter is required.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.

This parameter is required.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed. For more information, see [Regions that support real-time log delivery](https://help.aliyun.com/document_detail/144883.html).

This parameter is required.', example='cn-shanghai'),
}

model CreateRealTimeLogDeliveryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='F32C57AA-7BF8-49AE-A2CC-9F42390F5A19'),
}

model CreateRealTimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRealTimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Enables real-time log delivery for specific accelerated domain names.
 *
 * @description >  You can call this API operation up to 100 times per second per account.
 *
 * @param request CreateRealTimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRealTimeLogDeliveryResponse
 */
async function createRealTimeLogDeliveryWithOptions(request: CreateRealTimeLogDeliveryRequest, runtime: $RuntimeOptions): CreateRealTimeLogDeliveryResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateRealTimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables real-time log delivery for specific accelerated domain names.
 *
 * @description >  You can call this API operation up to 100 times per second per account.
 *
 * @param request CreateRealTimeLogDeliveryRequest
 * @return CreateRealTimeLogDeliveryResponse
 */
async function createRealTimeLogDelivery(request: CreateRealTimeLogDeliveryRequest): CreateRealTimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return createRealTimeLogDeliveryWithOptions(request, runtime);
}

model CreateUsageDetailDataExportTaskRequest {
  domainNames?: string(name='DomainNames', description='The domain names. If you do not specify the Group parameter, resource usage details of these domain names are exported.

If you do not specify this parameter, resource usage details are exported based on accounts.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.

This parameter is required.', example='2019-12-10T21:00:00Z'),
  group?: string(name='Group', description='The domain name group. If you specify this parameter, the **DomainNames** parameter is ignored.', example='xxx'),
  language?: string(name='Language', description='The language in which you want to export the file. Valid values:

*   **zh-cn**: Chinese. This is the default value.
*   **en-us**: English', example='en-us'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2019-12-10T20:00:00Z'),
  taskName?: string(name='TaskName', description='The name of the task.', example='Refresh'),
  type?: string(name='Type', description='The type of resource usage data to query. Valid values:

*   **flow**: traffic and bandwidth
*   **vas**: requests

This parameter is required.', example='flow'),
}

model CreateUsageDetailDataExportTaskResponseBody = {
  endTime?: string(name='EndTime', description='The end of the time range for which the data was queried.', example='2015-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ED61C6C3-8241-4187-AAA7-5157AE175CEC'),
  startTime?: string(name='StartTime', description='The beginning of the time range for which the data was queried.', example='2015-12-10T20:00:00Z'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='123456'),
}

model CreateUsageDetailDataExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUsageDetailDataExportTaskResponseBody(name='body'),
}

/**
 * @summary Creates a task to export resource usage details to an Excel file.
 *
 * @description *   You can create a task to query data in the last year. The maximum time range that can be queried is one month.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request CreateUsageDetailDataExportTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUsageDetailDataExportTaskResponse
 */
async function createUsageDetailDataExportTaskWithOptions(request: CreateUsageDetailDataExportTaskRequest, runtime: $RuntimeOptions): CreateUsageDetailDataExportTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.group)) {
    query['Group'] = request.group;
  }
  if (!$isNull(request.language)) {
    query['Language'] = request.language;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUsageDetailDataExportTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a task to export resource usage details to an Excel file.
 *
 * @description *   You can create a task to query data in the last year. The maximum time range that can be queried is one month.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request CreateUsageDetailDataExportTaskRequest
 * @return CreateUsageDetailDataExportTaskResponse
 */
async function createUsageDetailDataExportTask(request: CreateUsageDetailDataExportTaskRequest): CreateUsageDetailDataExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  return createUsageDetailDataExportTaskWithOptions(request, runtime);
}

model CreateUserUsageDataExportTaskRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2015-12-10T21:00:00Z'),
  language?: string(name='Language', description='The language in which you want to export the file. Default value: zh-cn. Valid values:

*   **zh-cn**: Chinese
*   **en-us**: English', example='zh-cn'),
  startTime?: string(name='StartTime', description='The start of the time range to query. The data is collected every 5 minutes.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2015-12-10T20:00:00Z'),
  taskName?: string(name='TaskName', description='The name of the task.', example='Refresh'),
}

model CreateUserUsageDataExportTaskResponseBody = {
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ED61C6C3-8241-4187-AAA7-5157AE175CEC'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2015-12-10T20:00:00Z'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='129456'),
}

model CreateUserUsageDataExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserUsageDataExportTaskResponseBody(name='body'),
}

/**
 * @summary Creates a task to export your resource usage history to a PDF file.
 *
 * @description *   You can create a task to query data in the last year. The maximum time range that can be queried is one month.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request CreateUserUsageDataExportTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUserUsageDataExportTaskResponse
 */
async function createUserUsageDataExportTaskWithOptions(request: CreateUserUsageDataExportTaskRequest, runtime: $RuntimeOptions): CreateUserUsageDataExportTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.language)) {
    query['Language'] = request.language;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUserUsageDataExportTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a task to export your resource usage history to a PDF file.
 *
 * @description *   You can create a task to query data in the last year. The maximum time range that can be queried is one month.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request CreateUserUsageDataExportTaskRequest
 * @return CreateUserUsageDataExportTaskResponse
 */
async function createUserUsageDataExportTask(request: CreateUserUsageDataExportTaskRequest): CreateUserUsageDataExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  return createUserUsageDataExportTaskWithOptions(request, runtime);
}

model DeleteCdnDeliverTaskRequest {
  deliverId?: long(name='DeliverId', description='The ID of the tracking task that you want to delete. You can call the [DescribeCdnDeliverList](https://help.aliyun.com/document_detail/270877.html) operation to query task IDs.

This parameter is required.', example='1'),
}

model DeleteCdnDeliverTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteCdnDeliverTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCdnDeliverTaskResponseBody(name='body'),
}

/**
 * @summary Deletes tracking tasks by task ID.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request DeleteCdnDeliverTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCdnDeliverTaskResponse
 */
async function deleteCdnDeliverTaskWithOptions(request: DeleteCdnDeliverTaskRequest, runtime: $RuntimeOptions): DeleteCdnDeliverTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deliverId)) {
    query['DeliverId'] = request.deliverId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCdnDeliverTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes tracking tasks by task ID.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request DeleteCdnDeliverTaskRequest
 * @return DeleteCdnDeliverTaskResponse
 */
async function deleteCdnDeliverTask(request: DeleteCdnDeliverTaskRequest): DeleteCdnDeliverTaskResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCdnDeliverTaskWithOptions(request, runtime);
}

model DeleteCdnDomainRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name that you want to remove. You can specify only one domain name in each call.

This parameter is required.', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
}

model DeleteCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model DeleteCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCdnDomainResponseBody(name='body'),
}

/**
 * @summary Removes an accelerated domain name from Alibaba Cloud CDN.
 *
 * @description *   We recommend that you add an A record for the domain name in the system of your DNS service provider before you remove the domain name from Alibaba Cloud CDN. Otherwise, the domain name may become inaccessible. Proceed with caution.
 * *   After you successfully call the DeleteCdnDomain operation, all records of the removed domain name are deleted. If you need to only disable the domain name, we recommend that you call the StopCdnDomain operation.
 * *   You can call this operation up to 10 times per second per account.
 *
 * @param request DeleteCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCdnDomainResponse
 */
async function deleteCdnDomainWithOptions(request: DeleteCdnDomainRequest, runtime: $RuntimeOptions): DeleteCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes an accelerated domain name from Alibaba Cloud CDN.
 *
 * @description *   We recommend that you add an A record for the domain name in the system of your DNS service provider before you remove the domain name from Alibaba Cloud CDN. Otherwise, the domain name may become inaccessible. Proceed with caution.
 * *   After you successfully call the DeleteCdnDomain operation, all records of the removed domain name are deleted. If you need to only disable the domain name, we recommend that you call the StopCdnDomain operation.
 * *   You can call this operation up to 10 times per second per account.
 *
 * @param request DeleteCdnDomainRequest
 * @return DeleteCdnDomainResponse
 */
async function deleteCdnDomain(request: DeleteCdnDomainRequest): DeleteCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCdnDomainWithOptions(request, runtime);
}

model DeleteCdnSubTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteCdnSubTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCdnSubTaskResponseBody(name='body'),
}

/**
 * @summary The ID of the request.
 *
 * @description >  You can call this API operation up to three times per second per account.
 *
 * @param request DeleteCdnSubTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCdnSubTaskResponse
 */
async function deleteCdnSubTaskWithOptions(runtime: $RuntimeOptions): DeleteCdnSubTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DeleteCdnSubTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The ID of the request.
 *
 * @description >  You can call this API operation up to three times per second per account.
 *
 * @return DeleteCdnSubTaskResponse
 */
async function deleteCdnSubTask(): DeleteCdnSubTaskResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCdnSubTaskWithOptions(runtime);
}

model DeleteFCTriggerRequest {
  triggerARN?: string(name='TriggerARN', description='The trigger that corresponds to the Function Compute service.

This parameter is required.', example='acs:cdn:{RegionID}:{AccountID}:{Filter}'),
}

model DeleteFCTriggerResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EC046C5D-8CB4-4B6B-B7F8-B335E51EF90E'),
}

model DeleteFCTriggerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFCTriggerResponseBody(name='body'),
}

/**
 * @summary Deletes a specified Function Compute trigger.
 *
 * @param request DeleteFCTriggerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFCTriggerResponse
 */
async function deleteFCTriggerWithOptions(request: DeleteFCTriggerRequest, runtime: $RuntimeOptions): DeleteFCTriggerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.triggerARN)) {
    query['TriggerARN'] = request.triggerARN;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteFCTrigger',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a specified Function Compute trigger.
 *
 * @param request DeleteFCTriggerRequest
 * @return DeleteFCTriggerResponse
 */
async function deleteFCTrigger(request: DeleteFCTriggerRequest): DeleteFCTriggerResponse {
  var runtime = new $RuntimeOptions{};
  return deleteFCTriggerWithOptions(request, runtime);
}

model DeleteRealTimeLogLogstoreRequest {
  logstore?: string(name='Logstore', description='The name of the Logstore to which log entries are delivered.

This parameter is required.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.

This parameter is required.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed. For more information, see [Regions that support real-time log delivery](https://help.aliyun.com/document_detail/144883.html).

This parameter is required.', example='cn-shanghai'),
}

model DeleteRealTimeLogLogstoreResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9732E117-8A37-49FD-A36F-ABBB87556CA7'),
}

model DeleteRealTimeLogLogstoreResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRealTimeLogLogstoreResponseBody(name='body'),
}

/**
 * @summary Deletes the Logstore that is used by a specified configuration record of real-time log delivery.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteRealTimeLogLogstoreRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRealTimeLogLogstoreResponse
 */
async function deleteRealTimeLogLogstoreWithOptions(request: DeleteRealTimeLogLogstoreRequest, runtime: $RuntimeOptions): DeleteRealTimeLogLogstoreResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRealTimeLogLogstore',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes the Logstore that is used by a specified configuration record of real-time log delivery.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteRealTimeLogLogstoreRequest
 * @return DeleteRealTimeLogLogstoreResponse
 */
async function deleteRealTimeLogLogstore(request: DeleteRealTimeLogLogstoreRequest): DeleteRealTimeLogLogstoreResponse {
  var runtime = new $RuntimeOptions{};
  return deleteRealTimeLogLogstoreWithOptions(request, runtime);
}

model DeleteRealtimeLogDeliveryRequest {
  domain?: string(name='Domain', description='The acceleration domain name for which you want to disable real-time log delivery. You can specify multiple domain names and separate them with commas (,).

This parameter is required.', example='example.com'),
  logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.

This parameter is required.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.

This parameter is required.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed. For more information, see [Regions that support real-time log delivery](https://help.aliyun.com/document_detail/144883.html).

This parameter is required.', example='cn-shanghai'),
}

model DeleteRealtimeLogDeliveryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9732E117-8A37-49FD-A36F-ABBB87556CA7'),
}

model DeleteRealtimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRealtimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Deletes the configurations of real-time log delivery for specific accelerated domain names.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteRealtimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRealtimeLogDeliveryResponse
 */
async function deleteRealtimeLogDeliveryWithOptions(request: DeleteRealtimeLogDeliveryRequest, runtime: $RuntimeOptions): DeleteRealtimeLogDeliveryResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRealtimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes the configurations of real-time log delivery for specific accelerated domain names.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteRealtimeLogDeliveryRequest
 * @return DeleteRealtimeLogDeliveryResponse
 */
async function deleteRealtimeLogDelivery(request: DeleteRealtimeLogDeliveryRequest): DeleteRealtimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return deleteRealtimeLogDeliveryWithOptions(request, runtime);
}

model DeleteSpecificConfigRequest {
  configId?: string(name='ConfigId', description='The ID of the configuration. Separate multiple configuration IDs with commas (,). For more information about ConfigId, see [Usage notes on ConfigId](https://help.aliyun.com/document_detail/388994.html).

This parameter is required.', example='2317'),
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteSpecificConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteSpecificConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSpecificConfigResponseBody(name='body'),
}

/**
 * @summary Deletes specified configurations of an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DeleteSpecificConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSpecificConfigResponse
 */
async function deleteSpecificConfigWithOptions(request: DeleteSpecificConfigRequest, runtime: $RuntimeOptions): DeleteSpecificConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSpecificConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes specified configurations of an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DeleteSpecificConfigRequest
 * @return DeleteSpecificConfigResponse
 */
async function deleteSpecificConfig(request: DeleteSpecificConfigRequest): DeleteSpecificConfigResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSpecificConfigWithOptions(request, runtime);
}

model DeleteSpecificStagingConfigRequest {
  configId?: string(name='ConfigId', description='The configuration IDs. Separate configuration IDs with commas (,). For more information about ConfigId, see [Usage notes on ConfigId](https://help.aliyun.com/document_detail/388994.html).

This parameter is required.', example='2317'),
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 50 domain names in each request. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteSpecificStagingConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteSpecificStagingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSpecificStagingConfigResponseBody(name='body'),
}

/**
 * @summary Deletes a specified configuration of the staging environment.
 *
 * @description > You can call this operation up to 20 times per second per account.
 *
 * @param request DeleteSpecificStagingConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSpecificStagingConfigResponse
 */
async function deleteSpecificStagingConfigWithOptions(request: DeleteSpecificStagingConfigRequest, runtime: $RuntimeOptions): DeleteSpecificStagingConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSpecificStagingConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a specified configuration of the staging environment.
 *
 * @description > You can call this operation up to 20 times per second per account.
 *
 * @param request DeleteSpecificStagingConfigRequest
 * @return DeleteSpecificStagingConfigResponse
 */
async function deleteSpecificStagingConfig(request: DeleteSpecificStagingConfigRequest): DeleteSpecificStagingConfigResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSpecificStagingConfigWithOptions(request, runtime);
}

model DeleteUsageDetailDataExportTaskRequest {
  taskId?: string(name='TaskId', description='The ID of the task. You can call the [DescribeUserUsageDataExportTask](https://help.aliyun.com/document_detail/91062.html) operation to query tasks.

This parameter is required.', example='10'),
}

model DeleteUsageDetailDataExportTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model DeleteUsageDetailDataExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUsageDetailDataExportTaskResponseBody(name='body'),
}

/**
 * @summary Deletes a task that was used to export usage details.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteUsageDetailDataExportTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUsageDetailDataExportTaskResponse
 */
async function deleteUsageDetailDataExportTaskWithOptions(request: DeleteUsageDetailDataExportTaskRequest, runtime: $RuntimeOptions): DeleteUsageDetailDataExportTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteUsageDetailDataExportTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a task that was used to export usage details.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteUsageDetailDataExportTaskRequest
 * @return DeleteUsageDetailDataExportTaskResponse
 */
async function deleteUsageDetailDataExportTask(request: DeleteUsageDetailDataExportTaskRequest): DeleteUsageDetailDataExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  return deleteUsageDetailDataExportTaskWithOptions(request, runtime);
}

model DeleteUserUsageDataExportTaskRequest {
  taskId?: string(name='TaskId', description='The ID of the task to delete.

This parameter is required.', example='10'),
}

model DeleteUserUsageDataExportTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model DeleteUserUsageDataExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserUsageDataExportTaskResponseBody(name='body'),
}

/**
 * @summary Deletes a task that was used to export usage history.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteUserUsageDataExportTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserUsageDataExportTaskResponse
 */
async function deleteUserUsageDataExportTaskWithOptions(request: DeleteUserUsageDataExportTaskRequest, runtime: $RuntimeOptions): DeleteUserUsageDataExportTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteUserUsageDataExportTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a task that was used to export usage history.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DeleteUserUsageDataExportTaskRequest
 * @return DeleteUserUsageDataExportTaskResponse
 */
async function deleteUserUsageDataExportTask(request: DeleteUserUsageDataExportTaskRequest): DeleteUserUsageDataExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  return deleteUserUsageDataExportTaskWithOptions(request, runtime);
}

model DescribeBlockedRegionsRequest {
  language?: string(name='Language', description='The language. Valid values:

*   **zh**: simplified Chinese
*   **en**: English
*   **jp**: Japanese

This parameter is required.', example='zh'),
}

model DescribeBlockedRegionsResponseBody = {
  infoList?: {
    infoItem?: [ 
    {
      continent?: string(name='Continent', description='The district to which the country or region belongs.', example='Asia'),
      countriesAndRegions?: string(name='CountriesAndRegions', description='The abbreviation of the name of the country or region.', example='AF'),
      countriesAndRegionsName?: string(name='CountriesAndRegionsName', description='The name of the country or region.', example='Afghanistan'),
    }
  ](name='InfoItem')
  }(name='InfoList', description='The information returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model DescribeBlockedRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBlockedRegionsResponseBody(name='body'),
}

/**
 * @summary Queries countries and regions that can be added to the blacklist.
 *
 * @description > You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeBlockedRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBlockedRegionsResponse
 */
async function describeBlockedRegionsWithOptions(request: DescribeBlockedRegionsRequest, runtime: $RuntimeOptions): DescribeBlockedRegionsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBlockedRegions',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries countries and regions that can be added to the blacklist.
 *
 * @description > You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeBlockedRegionsRequest
 * @return DescribeBlockedRegionsResponse
 */
async function describeBlockedRegions(request: DescribeBlockedRegionsRequest): DescribeBlockedRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeBlockedRegionsWithOptions(request, runtime);
}

model DescribeCdnCertificateDetailRequest {
  certName?: string(name='CertName', description='The ID of the SSL certificate. You can query only one certificate at a time.

This parameter is required.', example='cert-15480655xxxx'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnCertificateDetailResponseBody = {
  cert?: string(name='Cert', description='The certificate.', example='-----BEGIN CERTIFICATE-----\\\\nMIIFzDCCBLSgAwIBxxxx'),
  certId?: long(name='CertId', description='The ID of the certificate.', example='881049'),
  certName?: string(name='CertName', description='The name of the certificate.', example='cert-15480655xxxx'),
  key?: string(name='Key', description='The key of the SSL certificate.', example='xxxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model DescribeCdnCertificateDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnCertificateDetailResponseBody(name='body'),
}

/**
 * @summary Queries the detailed information about an SSL certificate.
 *
 * @description > You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeCdnCertificateDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnCertificateDetailResponse
 */
async function describeCdnCertificateDetailWithOptions(request: DescribeCdnCertificateDetailRequest, runtime: $RuntimeOptions): DescribeCdnCertificateDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnCertificateDetail',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the detailed information about an SSL certificate.
 *
 * @description > You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeCdnCertificateDetailRequest
 * @return DescribeCdnCertificateDetailResponse
 */
async function describeCdnCertificateDetail(request: DescribeCdnCertificateDetailRequest): DescribeCdnCertificateDetailResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnCertificateDetailWithOptions(request, runtime);
}

model DescribeCdnCertificateDetailByIdRequest {
  certId?: string(name='CertId', description='The ID of the certificate.

This parameter is required.', example='12345'),
  certRegion?: string(name='CertRegion', description='The region of the certificate. Valid values:

*   **ap-southeast-1**: Singapore
*   **cn-hangzhou**: China (Hangzhou)

Default value: **cn-hangzhou**', example='cn-hangzhou'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnCertificateDetailByIdResponseBody = {
  cert?: string(name='Cert', description='The content of the certificate.', example='-----BEGINCERTIFICATE-----xxx-----END CERTIFICATE-----'),
  certId?: long(name='CertId', description='The ID of the certificate.', example='12345'),
  certName?: string(name='CertName', description='The name of the certificate.', example='yourCertName'),
  key?: string(name='Key', description='The public key of the certificate.', example='587f6db37e3a2f01047b032b739cbe31'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C370DAF1-C838-4288-A1A0-9A87633D248E'),
}

model DescribeCdnCertificateDetailByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnCertificateDetailByIdResponseBody(name='body'),
}

/**
 * @summary Queries certificate details by certificate ID.
 *
 * @param request DescribeCdnCertificateDetailByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnCertificateDetailByIdResponse
 */
async function describeCdnCertificateDetailByIdWithOptions(request: DescribeCdnCertificateDetailByIdRequest, runtime: $RuntimeOptions): DescribeCdnCertificateDetailByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  if (!$isNull(request.certRegion)) {
    query['CertRegion'] = request.certRegion;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnCertificateDetailById',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries certificate details by certificate ID.
 *
 * @param request DescribeCdnCertificateDetailByIdRequest
 * @return DescribeCdnCertificateDetailByIdResponse
 */
async function describeCdnCertificateDetailById(request: DescribeCdnCertificateDetailByIdRequest): DescribeCdnCertificateDetailByIdResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnCertificateDetailByIdWithOptions(request, runtime);
}

model DescribeCdnCertificateListRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

If you do not specify an accelerated domain name, SSL certificates of all your accelerated domain names are queried.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnCertificateListResponseBody = {
  certificateListModel?: {
    certList?: {
      cert?: [ 
      {
        certId?: long(name='CertId', description='The ID of the certificate.', example='1'),
        certName?: string(name='CertName', description='The name of the certificate.', example='Certificate1'),
        common?: string(name='Common', description='The Common Name (CN) attribute of the certificate. In most cases, the CN is a domain name.', example='example.com'),
        fingerprint?: string(name='Fingerprint', description='The fingerprint of the certificate.', example='2ED68FD33786C5B42950D40A6C50353575BB****'),
        issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='CO****'),
        lastTime?: long(name='LastTime', description='The timestamp.', example='1512388610'),
      }
    ](name='Cert')
    }(name='CertList', description='The list of certificates.'),
    count?: int32(name='Count', description='The number of certificates that are returned.', example='2'),
  }(name='CertificateListModel', description='Details about certificates.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FC0E34AC-0239-44A7-AB0E-800DE522C8DA'),
}

model DescribeCdnCertificateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnCertificateListResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI DescribeCdnCertificateList is deprecated, please use Cdn::2018-05-10::DescribeCdnSSLCertificateList instead.
 *
 * @summary Queries the certificates of accelerated domain names.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnCertificateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnCertificateListResponse
 */
// Deprecated
async function describeCdnCertificateListWithOptions(request: DescribeCdnCertificateListRequest, runtime: $RuntimeOptions): DescribeCdnCertificateListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnCertificateList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @deprecated OpenAPI DescribeCdnCertificateList is deprecated, please use Cdn::2018-05-10::DescribeCdnSSLCertificateList instead.
 *
 * @summary Queries the certificates of accelerated domain names.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnCertificateListRequest
 * @return DescribeCdnCertificateListResponse
 */
// Deprecated
async function describeCdnCertificateList(request: DescribeCdnCertificateListRequest): DescribeCdnCertificateListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnCertificateListWithOptions(request, runtime);
}

model DescribeCdnConditionIPBInfoRequest {
  dataId?: string(name='DataId', description='The configuration ID. Valid values:

*   condition_region_config_cn
*   condition_region_config_en
*   condition_isp_config_cn
*   condition_isp_config_en
*   condition_country_config_cn
*   condition_country_config_en

This parameter is required.', example='condition_region_config_cn'),
}

model DescribeCdnConditionIPBInfoResponseBody = {
  datas?: [ 
    {
      value?: string(name='Value', description='The configuration value.', example='"[{\\\\"text\\\\":\\\\"阿鲁巴\\\\",\\\\"value\\\\":\\\\"AW\\\\"}]"'),
    }
  ](name='Datas', description='The data that is returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2C4AA72D-8C00-1113-BD68-8BC4E3CF4FF6'),
}

model DescribeCdnConditionIPBInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnConditionIPBInfoResponseBody(name='body'),
}

/**
 * @summary Queries the Internet service provider (ISP), region, and country that are required for advanced conditions.
 *
 * @param request DescribeCdnConditionIPBInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnConditionIPBInfoResponse
 */
async function describeCdnConditionIPBInfoWithOptions(request: DescribeCdnConditionIPBInfoRequest, runtime: $RuntimeOptions): DescribeCdnConditionIPBInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dataId)) {
    query['DataId'] = request.dataId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnConditionIPBInfo',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the Internet service provider (ISP), region, and country that are required for advanced conditions.
 *
 * @param request DescribeCdnConditionIPBInfoRequest
 * @return DescribeCdnConditionIPBInfoResponse
 */
async function describeCdnConditionIPBInfo(request: DescribeCdnConditionIPBInfoRequest): DescribeCdnConditionIPBInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnConditionIPBInfoWithOptions(request, runtime);
}

model DescribeCdnDeletedDomainsRequest {
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Valid values: **1** to **100000**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of domain names to return per page. Valid values: an integer between **1** and **500**. Default value: **20**.', example='5'),
}

model DescribeCdnDeletedDomainsResponseBody = {
  domains?: {
    pageData?: [ 
    {
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
      gmtModified?: string(name='GmtModified', description='The time when the accelerated domain name was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2015-10-28T11:05:52Z'),
    }
  ](name='PageData')
  }(name='Domains', description='The list of accelerated domain names and the time each domain name was last modified.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page, which is the same as the **PageNumber** parameter in request parameters.', example='1'),
  pageSize?: long(name='PageSize', description='The number of domain names returned per page, which is the same as the **PageSize** parameter in request parameters.', example='5'),
  requestId?: string(name='RequestId', description='The request ID.', example='AA75AADB-5E25-4970-B480-EAA1F5658483'),
  totalCount?: long(name='TotalCount', description='The total number of domain names returned.', example='16'),
}

model DescribeCdnDeletedDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDeletedDomainsResponseBody(name='body'),
}

/**
 * @summary Queries the domain names that are deleted from your account.
 *
 * @description > You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeCdnDeletedDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDeletedDomainsResponse
 */
async function describeCdnDeletedDomainsWithOptions(request: DescribeCdnDeletedDomainsRequest, runtime: $RuntimeOptions): DescribeCdnDeletedDomainsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDeletedDomains',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the domain names that are deleted from your account.
 *
 * @description > You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeCdnDeletedDomainsRequest
 * @return DescribeCdnDeletedDomainsResponse
 */
async function describeCdnDeletedDomains(request: DescribeCdnDeletedDomainsRequest): DescribeCdnDeletedDomainsResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDeletedDomainsWithOptions(request, runtime);
}

model DescribeCdnDeliverListRequest {
  deliverId?: long(name='DeliverId', description='The ID of the tracking task that you want to query. If you do not specify an ID, all tracking tasks are queried.', example='3'),
}

model DescribeCdnDeliverListResponseBody = {
  content?: string(name='Content', description='The information about the tracking task.', example='"data": [{"deliverId": 1,"status": "enable","createTime": "2020-10-14T11:19:26Z","crontab": "0 0 0 \\\\* \\\\* ?","frequency": "d","name": "The name of the tracking task","dmList": ["www.example.com"],"reports": [{"reportId": 1,"conditions": [{"op": "in","field": "prov","value": ["Heilongjiang","Beijing"]}} },{"reportId": 2}],"deliver": {"email": {"subject": "subject","to": ["example@alibaba-inc.com","example@alibaba-inc.com"]}}}]}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='12345'),
}

model DescribeCdnDeliverListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDeliverListResponseBody(name='body'),
}

/**
 * @summary Queries one or more tracking tasks of operations reports.
 *
 * @description > You can call this operation up to 3 times per second per account.
 *
 * @param request DescribeCdnDeliverListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDeliverListResponse
 */
async function describeCdnDeliverListWithOptions(request: DescribeCdnDeliverListRequest, runtime: $RuntimeOptions): DescribeCdnDeliverListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deliverId)) {
    query['DeliverId'] = request.deliverId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDeliverList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more tracking tasks of operations reports.
 *
 * @description > You can call this operation up to 3 times per second per account.
 *
 * @param request DescribeCdnDeliverListRequest
 * @return DescribeCdnDeliverListResponse
 */
async function describeCdnDeliverList(request: DescribeCdnDeliverListRequest): DescribeCdnDeliverListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDeliverListWithOptions(request, runtime);
}

model DescribeCdnDomainAtoaLogsRequest {
  domainName?: string(name='DomainName', description='This parameter is required.'),
  endTime?: string(name='EndTime'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  startTime?: string(name='StartTime'),
}

model DescribeCdnDomainAtoaLogsResponseBody = {
  domainLogDetails?: {
    domainLogDetail?: [ 
    {
      domainName?: string(name='DomainName'),
      logCount?: long(name='LogCount'),
      logInfos?: {
        logInfoDetail?: [ 
        {
          endTime?: string(name='EndTime'),
          logName?: string(name='LogName'),
          logPath?: string(name='LogPath'),
          logSize?: long(name='LogSize'),
          startTime?: string(name='StartTime'),
        }
      ](name='LogInfoDetail')
      }(name='LogInfos'),
      pageInfos?: {
        pageIndex?: long(name='PageIndex'),
        pageSize?: long(name='PageSize'),
        total?: long(name='Total'),
      }(name='PageInfos'),
    }
  ](name='DomainLogDetail')
  }(name='DomainLogDetails'),
  requestId?: string(name='RequestId'),
}

model DescribeCdnDomainAtoaLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainAtoaLogsResponseBody(name='body'),
}

/**
 * @summary 天翼定制化小时日志下载接口
 *
 * @param request DescribeCdnDomainAtoaLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainAtoaLogsResponse
 */
async function describeCdnDomainAtoaLogsWithOptions(request: DescribeCdnDomainAtoaLogsRequest, runtime: $RuntimeOptions): DescribeCdnDomainAtoaLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainAtoaLogs',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 天翼定制化小时日志下载接口
 *
 * @param request DescribeCdnDomainAtoaLogsRequest
 * @return DescribeCdnDomainAtoaLogsResponse
 */
async function describeCdnDomainAtoaLogs(request: DescribeCdnDomainAtoaLogsRequest): DescribeCdnDomainAtoaLogsResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainAtoaLogsWithOptions(request, runtime);
}

model DescribeCdnDomainByCertificateRequest {
  exact?: boolean(name='Exact', description='Specifies whether the domain name list to return match the SSL certificate.

*   true: The domain name list match the SSL certificate.
*   false: The domain name list do not match the SSL certificate.', example='true'),
  SSLPub?: string(name='SSLPub', description='The public key of the SSL certificate. You must encode the public key in Base64 and then call the encodeURIComponent function to encode the public key again.

The public key must be in the PEM format.

This parameter is required.', example='******'),
  SSLStatus?: boolean(name='SSLStatus', description='Specifies whether the domain name list to return contains only domain names with HTTPS enabled or disabled.

*   true: The domain name list contains only domain names with HTTPS enabled.
*   false: The domain name list contains only domain names with HTTPS disabled.', example='true'),
}

model DescribeCdnDomainByCertificateResponseBody = {
  certInfos?: {
    certInfo?: [ 
    {
      certCaIsLegacy?: string(name='CertCaIsLegacy', description='Indicates whether the SSL certificate is obsolete. Valid values:

*   **yes**: The SSL certificate is obsolete.
*   **no**: The SSL certificate is working as expected.', example='yes'),
      certExpireTime?: string(name='CertExpireTime', description='The expiration time of the certificate.', example='Nov 29 00:00:00 2016 GMT'),
      certExpired?: string(name='CertExpired', description='Indicates whether the SSL certificate is expired. Valid values:

*   **yes**: The SSL certificate is expired.
*   **no**: The SSL certificate is not expired.', example='yes'),
      certStartTime?: string(name='CertStartTime', description='The time when the certificate became effective.', example='Nov 29 23:59:59 2017 GMT'),
      certSubjectCommonName?: string(name='CertSubjectCommonName', description='The name of the SSL certificate owner.', example='owner'),
      certType?: string(name='CertType', description='The type of the certificate. Valid values: **RSA**, **DSA**, and **ECDSA**.', example='RSA'),
      domainList?: string(name='DomainList', description='If a value is returned, the value matches the SSL certificate. Multiple domain names are separated by commas (,).', example='example.com,aliyundoc.com'),
      domainNames?: string(name='DomainNames', description='The domain names (DNS fields) that match the SSL certificate. Multiple domain names are separated by commas (,).', example='*.example.com,aliyundoc.com'),
      issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='C=US, O=Symantec Corporation, OU=Symantec Trust Network, OU=Domain Validated SSL, CN=Symantec Basic DV SSL CA - G1'),
    }
  ](name='CertInfo')
  }(name='CertInfos', description='The information about the certificate.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ASAF2FDS-12SADSA-DDSAE3D-DSADCD4C-CDADS2D'),
}

model DescribeCdnDomainByCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainByCertificateResponseBody(name='body'),
}

/**
 * @summary Queries accelerated domain names by SSL certificate.
 *
 * @description >  You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnDomainByCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainByCertificateResponse
 */
async function describeCdnDomainByCertificateWithOptions(request: DescribeCdnDomainByCertificateRequest, runtime: $RuntimeOptions): DescribeCdnDomainByCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.exact)) {
    query['Exact'] = request.exact;
  }
  if (!$isNull(request.SSLPub)) {
    query['SSLPub'] = request.SSLPub;
  }
  if (!$isNull(request.SSLStatus)) {
    query['SSLStatus'] = request.SSLStatus;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainByCertificate',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries accelerated domain names by SSL certificate.
 *
 * @description >  You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnDomainByCertificateRequest
 * @return DescribeCdnDomainByCertificateResponse
 */
async function describeCdnDomainByCertificate(request: DescribeCdnDomainByCertificateRequest): DescribeCdnDomainByCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainByCertificateWithOptions(request, runtime);
}

model DescribeCdnDomainConfigsRequest {
  configId?: string(name='ConfigId', description='The ID of the configuration. For more information about ConfigId, see [Usage notes on ConfigId](https://help.aliyun.com/document_detail/388994.html).', example='6295'),
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  functionNames?: string(name='FunctionNames', description='The names of the features. Separate multiple feature names with commas (,). For more information, see [Parameters for configuring features for domain names](https://help.aliyun.com/document_detail/388460.html).', example='aliauth'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnDomainConfigsResponseBody = {
  domainConfigs?: {
    domainConfig?: [ 
    {
      configId?: string(name='ConfigId', description='The ID of the configuration.', example='6295'),
      functionArgs?: {
        functionArg?: [ 
        {
          argName?: string(name='ArgName', description='The parameter name, which is the configuration item of **functionName**. You can configure multiple configuration items.', example='auth_type'),
          argValue?: string(name='ArgValue', description='The parameter value, which is the value of the configuration item of **functionName**.', example='req_auth'),
        }
      ](name='FunctionArg')
      }(name='FunctionArgs', description='The configuration of each feature.'),
      functionName?: string(name='FunctionName', description='The name of the feature.', example='aliauth'),
      parentId?: string(name='ParentId', description='The ID of the rule condition. This parameter is optional.

To create a rule condition, you can configure the **condition** feature that is described in the [Parameters for configuring features for domain names](https://help.aliyun.com/document_detail/388460.html) topic. A rule condition can identify parameters that are included in requests and filter requests based on the identified parameters. Each rule condition has a [ConfigId](https://help.aliyun.com/document_detail/388994.html). You can use ConfigId as ParentId that is referenced by other features. This way, you can combine rule conditions and features for flexible configurations.

For more information, see [BatchSetCdnDomainConfig](https://help.aliyun.com/document_detail/90915.html) or ParentId configuration example in this topic.', example='222728944812032'),
      status?: string(name='Status', description='The status of the configuration. Valid values:

*   **success**
*   **testing**
*   **failed**
*   **configuring**', example='success'),
    }
  ](name='DomainConfig')
  }(name='DomainConfigs', description='The configurations of the domain name.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C80705BF-0F76-41FA-BAD1-5B59296A4E59'),
}

model DescribeCdnDomainConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainConfigsResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of an accelerated domain name. You can query the configurations of one or more features at the same time.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnDomainConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainConfigsResponse
 */
async function describeCdnDomainConfigsWithOptions(request: DescribeCdnDomainConfigsRequest, runtime: $RuntimeOptions): DescribeCdnDomainConfigsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.functionNames)) {
    query['FunctionNames'] = request.functionNames;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainConfigs',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configurations of an accelerated domain name. You can query the configurations of one or more features at the same time.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnDomainConfigsRequest
 * @return DescribeCdnDomainConfigsResponse
 */
async function describeCdnDomainConfigs(request: DescribeCdnDomainConfigsRequest): DescribeCdnDomainConfigsResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainConfigsWithOptions(request, runtime);
}

model DescribeCdnDomainDetailRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnDomainDetailResponseBody = {
  getDomainDetailModel?: {
    cdnType?: string(name='CdnType', description='The workload type of the accelerated domain name. Valid values:

*   **web**: images and small files
*   **download**: large files
*   **video**: on-demand video and audio streaming', example='web'),
    cname?: string(name='Cname', description='The CNAME that is assigned to the accelerated domain name. You must add the CNAME record in the system of your DNS service provider to map the accelerated domain name to the CNAME.', example='example.com.w.kunlunle.com'),
    description?: string(name='Description', description='The description of the domain name.', example='Streaming domain'),
    domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
    domainStatus?: string(name='DomainStatus', description='The status of the accelerated domain name. Valid values:

*   **online**
*   **offline**
*   **configuring**
*   **configure_failed**
*   **checking**
*   **check_failed**
*   **stopping**
*   **deleting**', example='online'),
    gmtCreated?: string(name='GmtCreated', description='The time when the domain name was created.', example='2015-06-25T03:30:50Z'),
    gmtModified?: string(name='GmtModified', description='The time when the domain name was last modified.', example='2017-06-25T03:30:50Z'),
    httpsCname?: string(name='HttpsCname', description='The CNAME for which HTTPS is enabled.', example='example.com.w.kunlunle.com'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='abcd1234abcd1234'),
    scope?: string(name='Scope', description='The acceleration region.', example='domestic'),
    serverCertificateStatus?: string(name='ServerCertificateStatus', description='Indicates whether the SSL certificate is enabled. Valid values:

*   **on**
*   **off**', example='on'),
    sourceModels?: {
      sourceModel?: [ 
      {
        content?: string(name='Content', description='The address of the origin server.', example='example.com'),
        enabled?: string(name='Enabled', description='The status.', example='online'),
        port?: int32(name='Port', description='The port over which requests are redirected to the origin server. Ports 443 and 80 are supported.', example='80'),
        priority?: string(name='Priority', description='The priority.', example='20'),
        type?: string(name='Type', description='The type of the origin server. Valid values:

*   **ipaddr**: an origin IP address
*   **domain**: an origin domain name
*   **oss**: the domain name of an Object Storage Service (OSS) bucket
*   **fc_domain:** a Function Compute domain name', example='domain'),
        weight?: string(name='Weight', description='The weight of the origin server if multiple origin servers have been specified.', example='10'),
      }
    ](name='SourceModel')
    }(name='SourceModels', description='The information about the origin server.'),
  }(name='GetDomainDetailModel', description='The details about the accelerated domain name.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='18CF38AA-1275-451D-A12B-4EC0BF1C5E30'),
}

model DescribeCdnDomainDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainDetailResponseBody(name='body'),
}

/**
 * @summary Queries the basic information about an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnDomainDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainDetailResponse
 */
async function describeCdnDomainDetailWithOptions(request: DescribeCdnDomainDetailRequest, runtime: $RuntimeOptions): DescribeCdnDomainDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainDetail',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the basic information about an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnDomainDetailRequest
 * @return DescribeCdnDomainDetailResponse
 */
async function describeCdnDomainDetail(request: DescribeCdnDomainDetailRequest): DescribeCdnDomainDetailResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainDetailWithOptions(request, runtime);
}

model DescribeCdnDomainLogsRequest {
  domainName?: string(name='DomainName', description='The domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2017-12-22T08:00:00Z'),
  pageNumber?: long(name='PageNumber', description='The number of the page to return. Pages start from page **1**.', example='2'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Default value: **300**. Maximum value: **1000**. Valid values: **1** to **1000**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-12-21T08:00:00Z'),
}

model DescribeCdnDomainLogsResponseBody = {
  domainLogDetails?: {
    domainLogDetail?: [ 
    {
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
      logCount?: long(name='LogCount', description='The total number of entries returned on the current page.', example='10'),
      logInfos?: {
        logInfoDetail?: [ 
        {
          endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-05-23T14:00:00Z'),
          logName?: string(name='LogName', description='The name of the log file.', example='demo.aliyundoc.com_2015_05_23_2100_2200.gz'),
          logPath?: string(name='LogPath', description='The path of the log file.', example='guide.aliyundoc.com-hangzhou.xxx'),
          logSize?: long(name='LogSize', description='The size of the log file.', example='258'),
          startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2015-05-23T13:00:00Z'),
        }
      ](name='LogInfoDetail')
      }(name='LogInfos', description='A set of LogInfoDetail data.'),
      pageInfos?: {
        pageIndex?: long(name='PageIndex', description='The page number of the returned page.', example='1'),
        pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='20'),
        total?: long(name='Total', description='The total number of entries returned.', example='20'),
      }(name='PageInfos', description='A set of PageInfoDetail data.'),
    }
  ](name='DomainLogDetail')
  }(name='DomainLogDetails', description='A set of DomainLogDetail data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model DescribeCdnDomainLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainLogsResponseBody(name='body'),
}

/**
 * @summary Queries the address where you can download the log data of a specific domain name.
 *
 * @description *   If you do not set **StartTime** or **EndTime**, the request returns the data collected in the last 24 hours. If you set both **StartTime** and **EndTime**, the request returns the data collected within the specified time range.
 * *   The log data is collected every hour.
 * *   You can call this operation up to 100 times per second per account.
 * *   You can query only logs in the last month. The start time and the current time cannot exceed 31 days.
 *
 * @param request DescribeCdnDomainLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainLogsResponse
 */
async function describeCdnDomainLogsWithOptions(request: DescribeCdnDomainLogsRequest, runtime: $RuntimeOptions): DescribeCdnDomainLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainLogs',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the address where you can download the log data of a specific domain name.
 *
 * @description *   If you do not set **StartTime** or **EndTime**, the request returns the data collected in the last 24 hours. If you set both **StartTime** and **EndTime**, the request returns the data collected within the specified time range.
 * *   The log data is collected every hour.
 * *   You can call this operation up to 100 times per second per account.
 * *   You can query only logs in the last month. The start time and the current time cannot exceed 31 days.
 *
 * @param request DescribeCdnDomainLogsRequest
 * @return DescribeCdnDomainLogsResponse
 */
async function describeCdnDomainLogs(request: DescribeCdnDomainLogsRequest): DescribeCdnDomainLogsResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainLogsWithOptions(request, runtime);
}

model DescribeCdnDomainLogsExTtlRequest {
  domainName?: string(name='DomainName', description='This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', example='2019-12-22T12:00:00Z'),
  pageNumber?: long(name='PageNumber', example='2'),
  pageSize?: long(name='PageSize', example='300'),
  startTime?: string(name='StartTime', example='2019-12-21T12:00:00Z'),
}

model DescribeCdnDomainLogsExTtlResponseBody = {
  domainLogDetails?: {
    domainLogDetail?: [ 
    {
      domainName?: string(name='DomainName', example='example.com'),
      logCount?: long(name='LogCount', example='10'),
      logInfos?: {
        logInfoDetail?: [ 
        {
          endTime?: string(name='EndTime', example='2023-09-23T14:00:00Z'),
          logName?: string(name='LogName', example='demo.aliyundoc.com_2015_05_23_2100_2200.gz'),
          logPath?: string(name='LogPath', example='guide.aliyundoc.com-hangzhou.xxx'),
          logSize?: long(name='LogSize', example='258'),
          startTime?: string(name='StartTime', example='2023-09-23T13:00:00Z'),
        }
      ](name='LogInfoDetail')
      }(name='LogInfos'),
      pageInfos?: {
        pageIndex?: long(name='PageIndex', example='1'),
        pageSize?: long(name='PageSize', example='20'),
        total?: long(name='Total', example='20'),
      }(name='PageInfos'),
    }
  ](name='DomainLogDetail')
  }(name='DomainLogDetails'),
  requestId?: string(name='RequestId', example='64D28B53-5902-409B-94F6-FD46680144FE'),
}

model DescribeCdnDomainLogsExTtlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainLogsExTtlResponseBody(name='body'),
}

/**
 * @summary 查询离线日志下载地址
 *
 * @param request DescribeCdnDomainLogsExTtlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainLogsExTtlResponse
 */
async function describeCdnDomainLogsExTtlWithOptions(request: DescribeCdnDomainLogsExTtlRequest, runtime: $RuntimeOptions): DescribeCdnDomainLogsExTtlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainLogsExTtl',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询离线日志下载地址
 *
 * @param request DescribeCdnDomainLogsExTtlRequest
 * @return DescribeCdnDomainLogsExTtlResponse
 */
async function describeCdnDomainLogsExTtl(request: DescribeCdnDomainLogsExTtlRequest): DescribeCdnDomainLogsExTtlResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainLogsExTtlWithOptions(request, runtime);
}

model DescribeCdnDomainStagingConfigRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  functionNames?: string(name='FunctionNames', description='The list of feature names. Separate multiple values with commas (,). For more information, see [A list of features](https://help.aliyun.com/document_detail/388460.html).', example='aliauth'),
}

model DescribeCdnDomainStagingConfigResponseBody = {
  domainConfigs?: [ 
    {
      configId?: string(name='ConfigId', description='The configuration ID.', example='6xx5'),
      functionArgs?: [ 
        {
          argName?: string(name='ArgName', description='The configuration name.', example='auth_type'),
          argValue?: string(name='ArgValue', description='The configuration value.', example='req_auth'),
        }
      ](name='FunctionArgs', description='The description of each feature.'),
      functionName?: string(name='FunctionName', description='The feature name.', example='aliauth'),
      parentId?: string(name='ParentId', description='The rule condition ID. This parameter is optional. To create a rule condition, you can configure the **condition** feature that is described in the [Parameters for configuring features for domain names](https://help.aliyun.com/document_detail/388460.html) topic. A rule condition can identify parameters that are included in requests and filter requests based on the identified parameters. Each rule condition has a [ConfigId](https://help.aliyun.com/document_detail/388994.html). You can reference ConfigId instead of ParentId in other features. This way, you can combine rule conditions and features for flexible configurations. For more information, see [BatchSetCdnDomainConfig](https://help.aliyun.com/document_detail/90915.html) or ParentId configuration example in this topic.', example='222728944812032'),
      status?: string(name='Status', description='The configuration status. Valid values:

*   **testing**
*   **configuring**
*   **success**
*   **failed**', example='success'),
    }
  ](name='DomainConfigs', description='The domain name configurations.'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The request ID.', example='C80705BF-0F76-41FA-BAD1-5B59296A4E59'),
}

model DescribeCdnDomainStagingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnDomainStagingConfigResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of features in the staging environment.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnDomainStagingConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnDomainStagingConfigResponse
 */
async function describeCdnDomainStagingConfigWithOptions(request: DescribeCdnDomainStagingConfigRequest, runtime: $RuntimeOptions): DescribeCdnDomainStagingConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.functionNames)) {
    query['FunctionNames'] = request.functionNames;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnDomainStagingConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configurations of features in the staging environment.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnDomainStagingConfigRequest
 * @return DescribeCdnDomainStagingConfigResponse
 */
async function describeCdnDomainStagingConfig(request: DescribeCdnDomainStagingConfigRequest): DescribeCdnDomainStagingConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnDomainStagingConfigWithOptions(request, runtime);
}

model DescribeCdnFullDomainsBlockIPConfigRequest {
  IPList?: string(name='IPList', description='The IP address or CIDR block to query. Separate multiple values with commas (,). You can specify up to 50 IP addresses or CIDR blocks.', example='1.XXX.XXX.1,2.XXX.XXX.2'),
}

model DescribeCdnFullDomainsBlockIPConfigResponseBody = {
  code?: int32(name='Code', description='The response code.

The value of Code is not 0 in the following scenarios:

*   The format of the IP address is invalid.
*   The number of IP addresses exceeds the upper limit.
*   Other abnormal scenarios.', example='0'),
  message?: string(name='Message', description='The returned results. If the operation is successful, URLs of OSS objects are returned. If the operation fails, an error message is returned.', example='http://xxxx-api.oss-cn-hangzhou.aliyuncs.com/blocklist%2Fxxxxxxxxxxxx.txt?Expires=1682663947&OSSAccessKeyId=xxxxxxxxxx&Signature=xxxxxx'),
  requestId?: string(name='RequestId', description='The request ID.', example='95994621-8382-464B-8762-C708E73568D1'),
}

model DescribeCdnFullDomainsBlockIPConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnFullDomainsBlockIPConfigResponseBody(name='body'),
}

/**
 * @summary You can call the DescribeCdnFullDomainsBlockIPConfig operation to query the configurations of full blocking.
 *
 * @description > 
 * *   To use this operation,[submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).
 * *   If you specify IP addresses or CIDR blocks, IP addresses that are effective and the corresponding expiration time are returned. If you do not specify IP addresses or CIDR blocks, all effective IP addresses and the corresponding expiration time are returned.
 * *   The results are written to OSS and returned as OSS URLs. The content in OSS objects is in the format of IP address-Corresponding expiration time. The expiration time is in the YYYY-MM-DD hh:mm:ss format.
 * *   You can share OSS URLs with others. The shared URLs are valid for three days.
 *
 * @param request DescribeCdnFullDomainsBlockIPConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnFullDomainsBlockIPConfigResponse
 */
async function describeCdnFullDomainsBlockIPConfigWithOptions(request: DescribeCdnFullDomainsBlockIPConfigRequest, runtime: $RuntimeOptions): DescribeCdnFullDomainsBlockIPConfigResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.IPList)) {
    body['IPList'] = request.IPList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnFullDomainsBlockIPConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call the DescribeCdnFullDomainsBlockIPConfig operation to query the configurations of full blocking.
 *
 * @description > 
 * *   To use this operation,[submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).
 * *   If you specify IP addresses or CIDR blocks, IP addresses that are effective and the corresponding expiration time are returned. If you do not specify IP addresses or CIDR blocks, all effective IP addresses and the corresponding expiration time are returned.
 * *   The results are written to OSS and returned as OSS URLs. The content in OSS objects is in the format of IP address-Corresponding expiration time. The expiration time is in the YYYY-MM-DD hh:mm:ss format.
 * *   You can share OSS URLs with others. The shared URLs are valid for three days.
 *
 * @param request DescribeCdnFullDomainsBlockIPConfigRequest
 * @return DescribeCdnFullDomainsBlockIPConfigResponse
 */
async function describeCdnFullDomainsBlockIPConfig(request: DescribeCdnFullDomainsBlockIPConfigRequest): DescribeCdnFullDomainsBlockIPConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnFullDomainsBlockIPConfigWithOptions(request, runtime);
}

model DescribeCdnFullDomainsBlockIPHistoryRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The end time must be later than the start time.

This parameter is required.', example='2023-04-24T19:00:00Z'),
  IPList?: string(name='IPList', description='The IP address or CIDR blocks to query.

This parameter is required.', example='1.XXX.XXX.1,2.XXX.XXX.2'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

This parameter is required.', example='2023-04-24T17:00:00Z'),
}

model DescribeCdnFullDomainsBlockIPHistoryResponseBody = {
  code?: int32(name='Code', description='The response code.

The value of Code is not 0 in the following scenarios:

*   The format of the IP address is invalid.
*   The format of the time is invalid.
*   Other abnormal scenarios.', example='0'),
  description?: string(name='Description', description='The description of the status returned.', example='OK'),
  IPBlockInfo?: [ 
    {
      blockIP?: string(name='BlockIP', description='The blocked IP address or CIDR block.', example='1.XXX.XXX.0~1.XXX.XXX.255'),
      deliverTime?: string(name='DeliverTime', description='The delivery time.', example='2023-04-24 18:49:37'),
      status?: string(name='Status', description='The delivery status.

*   Success
*   Failed', example='Success'),
    }
  ](name='IPBlockInfo', description='The result of the operation.'),
  requestId?: string(name='RequestId', description='The request ID.', example='BCD7D917-76F1-442F-BB75-C810DE34C761'),
}

model DescribeCdnFullDomainsBlockIPHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnFullDomainsBlockIPHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the blocking history.
 *
 * @description > 
 * *   To use this operation, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).
 * *   For a specified IP addresses and time range, the time when the IP address was delivered to the edge and the corresponding result are returned.
 * *   If a specified IP address or CIDR block has multiple blocking records in a specified time range, the records are sorted by delivery time in descending order.
 * *   The maximum time range to query is 90 days.
 * *   If no blocking record exists or delivery fails for the given IP address and time range, the delivery time is empty.
 *
 * @param request DescribeCdnFullDomainsBlockIPHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnFullDomainsBlockIPHistoryResponse
 */
async function describeCdnFullDomainsBlockIPHistoryWithOptions(request: DescribeCdnFullDomainsBlockIPHistoryRequest, runtime: $RuntimeOptions): DescribeCdnFullDomainsBlockIPHistoryResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!$isNull(request.IPList)) {
    body['IPList'] = request.IPList;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnFullDomainsBlockIPHistory',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the blocking history.
 *
 * @description > 
 * *   To use this operation, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).
 * *   For a specified IP addresses and time range, the time when the IP address was delivered to the edge and the corresponding result are returned.
 * *   If a specified IP address or CIDR block has multiple blocking records in a specified time range, the records are sorted by delivery time in descending order.
 * *   The maximum time range to query is 90 days.
 * *   If no blocking record exists or delivery fails for the given IP address and time range, the delivery time is empty.
 *
 * @param request DescribeCdnFullDomainsBlockIPHistoryRequest
 * @return DescribeCdnFullDomainsBlockIPHistoryResponse
 */
async function describeCdnFullDomainsBlockIPHistory(request: DescribeCdnFullDomainsBlockIPHistoryRequest): DescribeCdnFullDomainsBlockIPHistoryResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnFullDomainsBlockIPHistoryWithOptions(request, runtime);
}

model DescribeCdnHttpsDomainListRequest {
  keyword?: string(name='Keyword', description='The keyword that is used to search for certificates.', example='com'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Valid values: **1** to **100000**.', example='5'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: **20**.', example='20'),
}

model DescribeCdnHttpsDomainListResponseBody = {
  certInfos?: {
    certInfo?: [ 
    {
      certCommonName?: string(name='CertCommonName', description='The returned primary domain name of the certificate.', example='example.org'),
      certExpireTime?: string(name='CertExpireTime', description='The time at which the certificate expires.', example='2018-12-26 14:45:09'),
      certName?: string(name='CertName', description='The name of the certificate.', example='test'),
      certStartTime?: string(name='CertStartTime', description='The time at which the certificate became effective.', example='2018-11-26 14:45:09'),
      certStatus?: string(name='CertStatus', description='The status of the certificate.

*   **ok**: The certificate is working as expected.
*   **mismatch**: The certificate does not match the specified domain name.
*   **expired**: The certificate has expired.
*   **expire_soon**: The certificate will expire soon.', example='mismatch'),
      certType?: string(name='CertType', description='The type of the certificate.

*   **free**: a free certificate.
*   **cas**: a certificate that is purchased from Alibaba Cloud SSL Certificates Service.
*   **upload**: a certificate that is uploaded by the user.', example='free'),
      certUpdateTime?: string(name='CertUpdateTime', description='The time at which the certificate was updated.', example='2019-01-08 18:33:16'),
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
    }
  ](name='CertInfo')
  }(name='CertInfos', description='The information about the certificate.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F5E8DF64-7175-4186-9B06-F002C0BBD0C5'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='16'),
}

model DescribeCdnHttpsDomainListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnHttpsDomainListResponseBody(name='body'),
}

/**
 * @summary Queries the information about SSL certificates that belong to your Alibaba Cloud account.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnHttpsDomainListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnHttpsDomainListResponse
 */
async function describeCdnHttpsDomainListWithOptions(request: DescribeCdnHttpsDomainListRequest, runtime: $RuntimeOptions): DescribeCdnHttpsDomainListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnHttpsDomainList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about SSL certificates that belong to your Alibaba Cloud account.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnHttpsDomainListRequest
 * @return DescribeCdnHttpsDomainListResponse
 */
async function describeCdnHttpsDomainList(request: DescribeCdnHttpsDomainListRequest): DescribeCdnHttpsDomainListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnHttpsDomainListWithOptions(request, runtime);
}

model DescribeCdnMigrateRegisterStatusRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
}

model DescribeCdnMigrateRegisterStatusResponseBody = {
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the region.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  status?: string(name='Status', description='The registration status. Valid values:

*   **not exist**
*   **running**
*   **succeed**
*   **failed**', example='succeed'),
}

model DescribeCdnMigrateRegisterStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnMigrateRegisterStatusResponseBody(name='body'),
}

/**
 * @summary Queries the registration status of the dynamic routing feature of Dynamic Content Delivery Network (DCDN) for a domain name that is added to Alibaba Cloud CDN.
 *
 * @description >  If a domain name is not transferred from Alibaba Cloud CDN to DCDN after it is registered in the routing center of DCDN, the registration information is retained for only one day.
 *
 * @param request DescribeCdnMigrateRegisterStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnMigrateRegisterStatusResponse
 */
async function describeCdnMigrateRegisterStatusWithOptions(request: DescribeCdnMigrateRegisterStatusRequest, runtime: $RuntimeOptions): DescribeCdnMigrateRegisterStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnMigrateRegisterStatus',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the registration status of the dynamic routing feature of Dynamic Content Delivery Network (DCDN) for a domain name that is added to Alibaba Cloud CDN.
 *
 * @description >  If a domain name is not transferred from Alibaba Cloud CDN to DCDN after it is registered in the routing center of DCDN, the registration information is retained for only one day.
 *
 * @param request DescribeCdnMigrateRegisterStatusRequest
 * @return DescribeCdnMigrateRegisterStatusResponse
 */
async function describeCdnMigrateRegisterStatus(request: DescribeCdnMigrateRegisterStatusRequest): DescribeCdnMigrateRegisterStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnMigrateRegisterStatusWithOptions(request, runtime);
}

model DescribeCdnOrderCommodityCodeRequest {
  commodityCode?: string(name='CommodityCode', description='The original commodity code.

This parameter is required.', example='xxx'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnOrderCommodityCodeResponseBody = {
  orderCommodityCode?: string(name='OrderCommodityCode', description='The commodity code that includes the organization unit.', example='xxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BFFCDFAD-DACC-484E-9BE6-0AF3B3A0DD23'),
}

model DescribeCdnOrderCommodityCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnOrderCommodityCodeResponseBody(name='body'),
}

/**
 * @summary Queries the code of a commodity by account UID.
 *
 * @param request DescribeCdnOrderCommodityCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnOrderCommodityCodeResponse
 */
async function describeCdnOrderCommodityCodeWithOptions(request: DescribeCdnOrderCommodityCodeRequest, runtime: $RuntimeOptions): DescribeCdnOrderCommodityCodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.commodityCode)) {
    query['CommodityCode'] = request.commodityCode;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnOrderCommodityCode',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the code of a commodity by account UID.
 *
 * @param request DescribeCdnOrderCommodityCodeRequest
 * @return DescribeCdnOrderCommodityCodeResponse
 */
async function describeCdnOrderCommodityCode(request: DescribeCdnOrderCommodityCodeRequest): DescribeCdnOrderCommodityCodeResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnOrderCommodityCodeWithOptions(request, runtime);
}

model DescribeCdnRegionAndIspRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnRegionAndIspResponseBody = {
  isps?: {
    isp?: [ 
    {
      nameEn?: string(name='NameEn', description='The English name of the ISP.', example='unicom'),
      nameZh?: string(name='NameZh', description='The Chinese name of the ISP.'),
    }
  ](name='Isp')
  }(name='Isps', description='The list of ISPs.'),
  regions?: {
    region?: [ 
    {
      nameEn?: string(name='NameEn', description='The English name of the region.', example='liaoning'),
      nameZh?: string(name='NameZh', description='The Chinese name of the region.'),
    }
  ](name='Region')
  }(name='Regions', description='The list of regions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2387C335-932C-4E1E-862C-1C4363B6DE72'),
}

model DescribeCdnRegionAndIspResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnRegionAndIspResponseBody(name='body'),
}

/**
 * @summary Queries Internet service providers (ISPs) and regions that are supported by Alibaba Cloud CDN.
 *
 * @description *   The lists of ISPs and regions that are supported by Alibaba Cloud CDN are updated and published on the Alibaba Cloud International site.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnRegionAndIspRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnRegionAndIspResponse
 */
async function describeCdnRegionAndIspWithOptions(request: DescribeCdnRegionAndIspRequest, runtime: $RuntimeOptions): DescribeCdnRegionAndIspResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnRegionAndIsp',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries Internet service providers (ISPs) and regions that are supported by Alibaba Cloud CDN.
 *
 * @description *   The lists of ISPs and regions that are supported by Alibaba Cloud CDN are updated and published on the Alibaba Cloud International site.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnRegionAndIspRequest
 * @return DescribeCdnRegionAndIspResponse
 */
async function describeCdnRegionAndIsp(request: DescribeCdnRegionAndIspRequest): DescribeCdnRegionAndIspResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnRegionAndIspWithOptions(request, runtime);
}

model DescribeCdnReportRequest {
  area?: string(name='Area', description='The region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.

*   If you do not specify a region, data in all regions is queried.
*   If you specify a region, data in the specified region is queried. You can specify one or more regions. If you specify multiple regions, separate the regions with commas (,).', example='shanghai'),
  domainName?: string(name='DomainName', description='The domain name that you want to query. Separate domain names with commas (,).', example='www.example1.com,example2.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2020-09-17T01:00:00Z'),
  httpCode?: string(name='HttpCode', description='The HTTP status code. Valid values:

*   **2xx**
*   **3xx**
*   **4xx**
*   **5xx**

If you do not specify this parameter, all HTTP status codes are queried.', example='2xx'),
  isOverseas?: string(name='IsOverseas', description='Specifies whether the region is outside the Chinese mainland. Valid values:

*   **1**: outside the Chinese mainland
*   **0**: inside the Chinese mainland', example='0'),
  reportId?: long(name='ReportId', description='The ID of the operations report that you want to query. You can specify only one ID in each request. You can call the [DescribeCdnSubList](https://help.aliyun.com/document_detail/271655.html) operation to query report IDs.

This parameter is required.', example='1'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2020-09-17T00:00:00Z'),
}

model DescribeCdnReportResponseBody = {
  content?: map[string]any(name='Content', description='The content of the operations report.', example='"data":[{"deliver":{"report":{"title":"TopUrlByAcc","format":"table","shape":"","header":["url","traf","traf_rate","acc","acc_rate"]}},"data":[{"acc":440,"acc_rate":"0.200%","traf":22,"url":"http://demo.com","traf_rate":"0.100%"},{"acc":440,"acc_rate":"0.200%","traf":22,"url":"http://demo.com","traf_rate":"0.100%"}]}]}}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DescribeCdnReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnReportResponseBody(name='body'),
}

/**
 * @summary Queries the content of an operations report.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request DescribeCdnReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnReportResponse
 */
async function describeCdnReportWithOptions(request: DescribeCdnReportRequest, runtime: $RuntimeOptions): DescribeCdnReportResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.area)) {
    query['Area'] = request.area;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.httpCode)) {
    query['HttpCode'] = request.httpCode;
  }
  if (!$isNull(request.isOverseas)) {
    query['IsOverseas'] = request.isOverseas;
  }
  if (!$isNull(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnReport',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the content of an operations report.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request DescribeCdnReportRequest
 * @return DescribeCdnReportResponse
 */
async function describeCdnReport(request: DescribeCdnReportRequest): DescribeCdnReportResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnReportWithOptions(request, runtime);
}

model DescribeCdnReportListRequest {
  reportId?: long(name='ReportId', description='The ID of the operations report that you want to query. If you do not specify an ID, all operations reports are queried.', example='1'),
}

model DescribeCdnReportListResponseBody = {
  content?: string(name='Content', description='The information about the report that is queried.', example='"data":[{"reportId":1,"deliver":{"report":{"title":"DomainPvUv","format":"chart","shape":"line","xAxis":"ds","yAxis":"cnt","legend":"cnt_type","header":["ds","cnt_type","cnt"]}}}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DescribeCdnReportListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnReportListResponseBody(name='body'),
}

/**
 * @summary Queries operations reports.
 *
 * @description *   This operation queries the metadata of all operations reports. The statistics in the reports are not returned.
 * *   You can call this operation up to three times per second per account.
 *
 * @param request DescribeCdnReportListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnReportListResponse
 */
async function describeCdnReportListWithOptions(request: DescribeCdnReportListRequest, runtime: $RuntimeOptions): DescribeCdnReportListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnReportList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries operations reports.
 *
 * @description *   This operation queries the metadata of all operations reports. The statistics in the reports are not returned.
 * *   You can call this operation up to three times per second per account.
 *
 * @param request DescribeCdnReportListRequest
 * @return DescribeCdnReportListResponse
 */
async function describeCdnReportList(request: DescribeCdnReportListRequest): DescribeCdnReportListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnReportListWithOptions(request, runtime);
}

model DescribeCdnSMCertificateDetailRequest {
  certIdentifier?: string(name='CertIdentifier', description='The ID of the certificate.

This parameter is required.', example='648****-cn-hangzhou'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnSMCertificateDetailResponseBody = {
  certExpireTime?: string(name='CertExpireTime', description='The expiration time of the certificate. The time is displayed in UTC.', example='2022-08-31T09:42:28Z'),
  certIdentifier?: string(name='CertIdentifier', description='The ID of the certificate.', example='648****-cn-hangzhou'),
  certName?: string(name='CertName', description='The name of the certificate.', example='yourCertName'),
  certOrg?: string(name='CertOrg', description='The certificate authority (CA) that issued the certificate.', example='DigiCert Inc'),
  commonName?: string(name='CommonName', description='The common name.', example='example.com'),
  encryptCertificate?: string(name='EncryptCertificate', description='The content of the encryption certificate.', example='-BEGIN CERTIFICATE-----***-----END CERTIFICATE--'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A7C69682-7F88-40DD-A198-10D0309E439D'),
  sans?: string(name='Sans', description='The subdomain name.', example='***.example.com'),
  signCertificate?: string(name='SignCertificate', description='The content of the signature certificate.', example='--BEGIN CERTIFICATE-----***-----END CERTIFICATE--'),
}

model DescribeCdnSMCertificateDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnSMCertificateDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details about a ShangMi (SM) certificate.
 *
 * @description > You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeCdnSMCertificateDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnSMCertificateDetailResponse
 */
async function describeCdnSMCertificateDetailWithOptions(request: DescribeCdnSMCertificateDetailRequest, runtime: $RuntimeOptions): DescribeCdnSMCertificateDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnSMCertificateDetail',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about a ShangMi (SM) certificate.
 *
 * @description > You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeCdnSMCertificateDetailRequest
 * @return DescribeCdnSMCertificateDetailResponse
 */
async function describeCdnSMCertificateDetail(request: DescribeCdnSMCertificateDetailRequest): DescribeCdnSMCertificateDetailResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnSMCertificateDetailWithOptions(request, runtime);
}

model DescribeCdnSMCertificateListRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnSMCertificateListResponseBody = {
  certificateListModel?: {
    certList?: {
      cert?: [ 
      {
        certIdentifier?: string(name='CertIdentifier', description='The ID of the certificate.', example='yourCertldentifier'),
        certName?: string(name='CertName', description='The name of the certificate.', example='yourCertName'),
        common?: string(name='Common', description='The common name of the certificate.', example='yourCertCommon'),
        issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='yourCertIssuer'),
      }
    ](name='Cert')
    }(name='CertList', description='The list of certificates.'),
    count?: int32(name='Count', description='The number of certificates that are returned.', example='2'),
  }(name='CertificateListModel', description='The type of the certificate information.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DC0E34AC-0239-44A7-AB0E-800DE522C8DC'),
}

model DescribeCdnSMCertificateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnSMCertificateListResponseBody(name='body'),
}

/**
 * @summary Queries the ShangMi (SM) certificates of an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnSMCertificateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnSMCertificateListResponse
 */
async function describeCdnSMCertificateListWithOptions(request: DescribeCdnSMCertificateListRequest, runtime: $RuntimeOptions): DescribeCdnSMCertificateListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnSMCertificateList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the ShangMi (SM) certificates of an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnSMCertificateListRequest
 * @return DescribeCdnSMCertificateListResponse
 */
async function describeCdnSMCertificateList(request: DescribeCdnSMCertificateListRequest): DescribeCdnSMCertificateListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnSMCertificateListWithOptions(request, runtime);
}

model DescribeCdnSSLCertificateListRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.', example='www.example.com'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: long(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: an integer from **1** to **1000**.', example='20'),
  searchKeyword?: string(name='SearchKeyword', description='The keyword that is used to query the certificate.', example='certabc'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnSSLCertificateListResponseBody = {
  certificateListModel?: {
    certList?: {
      cert?: [ 
      {
        certId?: long(name='CertId', description='The ID of the certificate.', example='9128192'),
        certName?: string(name='CertName', description='The name of the certificate.', example='yourCertName'),
        certRegion?: string(name='CertRegion', description='The region ID of the certificate. Valid values: **cn-hangzhou** and **ap-southeast-1**. Default value: **cn-hangzhou**.', example='cn-hangzhou'),
        common?: string(name='Common', description='The Common Name (CN) attribute of the certificate. In most cases, the CN is a domain name.', example='example.com'),
        fingerprint?: string(name='Fingerprint', description='The fingerprint of the certificate.', example='933c6ddee95c9c41a40f9f50493d82be03ad87bf'),
        issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='yourCertIssuer'),
        lastTime?: long(name='LastTime', description='The time when the certificate was last modified. Unit: milliseconds.', example='1679896965'),
      }
    ](name='Cert')
    }(name='CertList', description='Details about each certificate.'),
    count?: int32(name='Count', description='The number of certificates.', example='2'),
    pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='2'),
    pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: an integer from 1 to 1000.', example='20'),
  }(name='CertificateListModel', description='The list of certificates.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E9D3257A-1B7C-414C-90C1-8D07AC47BCAC'),
}

model DescribeCdnSSLCertificateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnSSLCertificateListResponseBody(name='body'),
}

/**
 * @summary Queries the certificate list by domain name.
 *
 * @param request DescribeCdnSSLCertificateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnSSLCertificateListResponse
 */
async function describeCdnSSLCertificateListWithOptions(request: DescribeCdnSSLCertificateListRequest, runtime: $RuntimeOptions): DescribeCdnSSLCertificateListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchKeyword)) {
    query['SearchKeyword'] = request.searchKeyword;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnSSLCertificateList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the certificate list by domain name.
 *
 * @param request DescribeCdnSSLCertificateListRequest
 * @return DescribeCdnSSLCertificateListResponse
 */
async function describeCdnSSLCertificateList(request: DescribeCdnSSLCertificateListRequest): DescribeCdnSSLCertificateListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnSSLCertificateListWithOptions(request, runtime);
}

model DescribeCdnSecFuncInfoRequest {
  lang?: string(name='Lang', description='The language.

*   en: English
*   zh: Chinese

This parameter is required.', example='zh'),
  secFuncType?: string(name='SecFuncType', description='The type of the security feature. Valid values:

*   CipherSuiteGroupCustomize: custom cipher suite.
*   CipherSuiteGroupStrict: dustom cipher suite.

This parameter is required.', example='CipherSuiteGroupCustomize'),
}

model DescribeCdnSecFuncInfoResponseBody = {
  content?: [ 
    {
      label?: string(name='Label', description='The tag.', example='TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256'),
      value?: string(name='Value', description='The value.', example='TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256'),
    }
  ](name='Content', description='Queried data.'),
  description?: string(name='Description', description='The description.', example='OK'),
  httpStatus?: string(name='HttpStatus', description='The HTTP status code returned.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='BCD7D917-76F1-442F-BB75-C810DE34C761'),
  retCode?: string(name='RetCode', description='The HTTP request response code.

*   0: OK.
*   Values other than 0: an error.', example='0'),
}

model DescribeCdnSecFuncInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnSecFuncInfoResponseBody(name='body'),
}

/**
 * @summary Queries information about security features of Alibaba Cloud CDN.
 *
 * @param request DescribeCdnSecFuncInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnSecFuncInfoResponse
 */
async function describeCdnSecFuncInfoWithOptions(request: DescribeCdnSecFuncInfoRequest, runtime: $RuntimeOptions): DescribeCdnSecFuncInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!$isNull(request.secFuncType)) {
    query['SecFuncType'] = request.secFuncType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnSecFuncInfo',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries information about security features of Alibaba Cloud CDN.
 *
 * @param request DescribeCdnSecFuncInfoRequest
 * @return DescribeCdnSecFuncInfoResponse
 */
async function describeCdnSecFuncInfo(request: DescribeCdnSecFuncInfoRequest): DescribeCdnSecFuncInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnSecFuncInfoWithOptions(request, runtime);
}

model DescribeCdnServiceRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnServiceResponseBody = {
  changingAffectTime?: string(name='ChangingAffectTime', description='The time when the metering method for the next cycle takes effect. The time is displayed in GMT.', example='2019-11-27T16:00:00Z'),
  changingChargeType?: string(name='ChangingChargeType', description='The metering method for the next cycle. Valid values:

*   **PayByTraffic**: pay-by-data-transfer
*   **PayByBandwidth**: pay-by-bandwidth', example='PayByTraffic'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.', example='aliuidxx'),
  internetChargeType?: string(name='InternetChargeType', description='The current metering method. Valid values:

*   **PayByTraffic**: pay-by-data-transfer
*   **PayByBandwidth**: pay-by-bandwidth', example='PayByTraffic'),
  openingTime?: string(name='OpeningTime', description='The time when the service was activated. The time follows the ISO 8601 standard.', example='2019-02-28T13:11:49Z'),
  operationLocks?: {
    lockReason?: [ 
    {
      lockReason?: string(name='LockReason', description='The reason why the service is locked. A value of financial indicates that the service is locked due to overdue payments.', example='financial'),
    }
  ](name='LockReason')
  }(name='OperationLocks', description='The lock status.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model DescribeCdnServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnServiceResponseBody(name='body'),
}

/**
 * @summary Queries the status of your Alibaba Cloud CDN service. The information includes the service activation time, the current service status, the current metering method, and the metering method for the next cycle.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnServiceResponse
 */
async function describeCdnServiceWithOptions(request: DescribeCdnServiceRequest, runtime: $RuntimeOptions): DescribeCdnServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnService',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the status of your Alibaba Cloud CDN service. The information includes the service activation time, the current service status, the current metering method, and the metering method for the next cycle.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnServiceRequest
 * @return DescribeCdnServiceResponse
 */
async function describeCdnService(request: DescribeCdnServiceRequest): DescribeCdnServiceResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnServiceWithOptions(request, runtime);
}

model DescribeCdnSubListResponseBody = {
  content?: string(name='Content', description='The information about the custom report task.', example='{"RequestId":"3250A51D-C11D-46BA-B6B3-95348EEDE652","Description":"Successful","Content":{"data":[{"subId":5,"reportId":[1,2,3],"createTime":"2020-09-25T09:39:33Z","domains"["www.example.com","www.example.com"],"effectiveFrom":"2020-09-17T00:00:00Z","effectiveEnd":"2020-11-17T00:00:00Z","status":"enable"}]}}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3250A51D-C11D-46BA-B6B3-95348EEDE652'),
}

model DescribeCdnSubListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnSubListResponseBody(name='body'),
}

/**
 * @summary Queries the tracking tasks that you have created.
 *
 * @description *   By default, this operation queries all custom operations reports. However, only one operations report can be displayed. Therefore, only one operations report is returned.
 * *   You can call this operation up to three times per second per account.
 *
 * @param request DescribeCdnSubListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnSubListResponse
 */
async function describeCdnSubListWithOptions(runtime: $RuntimeOptions): DescribeCdnSubListResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnSubList',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the tracking tasks that you have created.
 *
 * @description *   By default, this operation queries all custom operations reports. However, only one operations report can be displayed. Therefore, only one operations report is returned.
 * *   You can call this operation up to three times per second per account.
 *
 * @return DescribeCdnSubListResponse
 */
async function describeCdnSubList(): DescribeCdnSubListResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnSubListWithOptions(runtime);
}

model DescribeCdnTypesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnTypesResponseBody = {
  cdnTypes?: {
    cdnType?: [ 
    {
      desc?: string(name='Desc', description='The description of the domain name type.', example='Download Acceleration'),
      type?: string(name='Type', description='The type of the domain name.', example='download'),
    }
  ](name='CdnType')
  }(name='CdnTypes', description='The types of the domain names.'),
  requestId?: string(name='RequestId', description='The request ID.', example='BDA62CE4-3477-439A-B52E-D2D7C829D7C1'),
}

model DescribeCdnTypesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnTypesResponseBody(name='body'),
}

/**
 * @summary Queries the types of domain names.
 *
 * @param request DescribeCdnTypesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnTypesResponse
 */
async function describeCdnTypesWithOptions(request: DescribeCdnTypesRequest, runtime: $RuntimeOptions): DescribeCdnTypesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnTypes',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the types of domain names.
 *
 * @param request DescribeCdnTypesRequest
 * @return DescribeCdnTypesResponse
 */
async function describeCdnTypes(request: DescribeCdnTypesRequest): DescribeCdnTypesResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnTypesWithOptions(request, runtime);
}

model DescribeCdnUserBillHistoryRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.

This parameter is required.', example='2018-10-31T16:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The minimum data granularity is 5 minutes.

This parameter is required.', example='2018-09-30T16:00:00Z'),
}

model DescribeCdnUserBillHistoryResponseBody = {
  billHistoryData?: {
    billHistoryDataItem?: [ 
    {
      billTime?: string(name='BillTime', description='The beginning of the time range that was queried.', example='2018-09-30T16:00:00Z'),
      billType?: string(name='BillType', description='The metering method.', example='month_4th_day_bandwidth'),
      billingData?: {
        billingDataItem?: [ 
        {
          bandwidth?: float(name='Bandwidth', description='The bandwidth. Unit: bit/s.', example='4041'),
          cdnRegion?: string(name='CdnRegion', description='The billable region. Valid values:

*   **CN**: Chinese mainland
*   **OverSeas**: outside the Chinese mainland
*   **AP1**: Asia Pacific 1
*   **AP2**: Asia Pacific 2
*   **AP3**: Asia Pacific 3
*   **NA**: North America
*   **SA**: South America
*   **EU**: Europe
*   **MEAA**: Middle East and Africa', example='AP1'),
          chargeType?: string(name='ChargeType', description='The billing method. Valid values:

*   **StaticHttp**: static HTTP requests
*   **DynamicHttp**: dynamic HTTP requests
*   **DynamicHttps**: dynamic HTTPS requests', example='DynamicHttp'),
          count?: float(name='Count', description='The number of requests.', example='203601'),
          flow?: float(name='Flow', description='The amount of network traffic. Unit: bytes.', example='24567'),
        }
      ](name='BillingDataItem')
      }(name='BillingData', description='The billable items.'),
      dimension?: string(name='Dimension', description='The dimension.', example='flow'),
    }
  ](name='BillHistoryDataItem')
  }(name='BillHistoryData', description='The billing history returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ED61C6C3-8241-4187-AAA7-5157AE175CEC'),
}

model DescribeCdnUserBillHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserBillHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the billing history under your Alibaba Cloud account.
 *
 * @description *   You can query billing history up to the last one month.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnUserBillHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserBillHistoryResponse
 */
async function describeCdnUserBillHistoryWithOptions(request: DescribeCdnUserBillHistoryRequest, runtime: $RuntimeOptions): DescribeCdnUserBillHistoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserBillHistory',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the billing history under your Alibaba Cloud account.
 *
 * @description *   You can query billing history up to the last one month.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnUserBillHistoryRequest
 * @return DescribeCdnUserBillHistoryResponse
 */
async function describeCdnUserBillHistory(request: DescribeCdnUserBillHistoryRequest): DescribeCdnUserBillHistoryResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserBillHistoryWithOptions(request, runtime);
}

model DescribeCdnUserBillPredictionRequest {
  area?: string(name='Area', description='The billable region. Valid values:

*   **CN**: the Chinese mainland
*   **OverSeas**: outside the Chinese mainland
*   **AP1**: Asia Pacific 1
*   **AP2**: Asia Pacific 2
*   **AP3**: Asia Pacific 3
*   **NA**: North America
*   **SA**: South America
*   **EU**: Europe
*   **MEAA**: Middle East and Africa

By default, the value of this parameter is determined by the metering method that is currently used. Regions inside and outside the Chinese mainland are classified into the **CN** and **OverSeas** billable regions. Billable regions inside the Chinese mainland include **CN**. Billable regions outside the Chinese mainland include **AP1**, **AP2**, **AP3**, **NA**, **SA**, **EU**, and **MEAA**.

> For more information about billable regions, see [Billable regions](https://help.aliyun.com/document_detail/142221.html).', example='CN,OverSeas'),
  dimension?: string(name='Dimension', description='The billable item. A value of flow specifies bandwidth.', example='flow'),
  endTime?: string(name='EndTime', description='The end time of the estimation. The default value is the current time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2018-10-25T10:00:00Z'),
  startTime?: string(name='StartTime', description='The start time of the estimation. The default value is 00:00 on the first day of the current month. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2018-09-30T16:00:00Z'),
}

model DescribeCdnUserBillPredictionResponseBody = {
  billPredictionData?: {
    billPredictionDataItem?: [ 
    {
      area?: string(name='Area', description='The billable region.', example='CN'),
      timeStp?: string(name='TimeStp', description='The time when the value used as the estimated value is generated. This parameter is returned only if the metering method is pay by 95th percentile, pay by 95th percentile bandwidth with 50% off from 00:00 to 08:00, or pay by 4th peak bandwidth per month.', example='2018-10-15T16:00:00Z'),
      value?: float(name='Value', description='The estimated value.', example='10000'),
    }
  ](name='BillPredictionDataItem')
  }(name='BillPredictionData', description='The estimated bill data.'),
  billType?: string(name='BillType', description='The metering method.

> If the metering method ends with _overseas, the billable region is outside the Chinese mainland. For example, BillType": "month_avg_day_bandwidth_overseas specifies a billable region outside the Chinese mainland and that the metering method is pay by daily peak bandwidth per month.

Valid values:

*   hour_flow: pay by hourly data transfer
*   day_bandwidth: pay by daily bandwidth
*   month_95: pay by monthly 95th percentile bandwidth.
*   month_avg_day_bandwidth: pay by average daily peak bandwidth per month
*   month_4th_day_bandwidth: pay by monthly 4th peak bandwidth
*   month_avg_day_95: pay by average daily 95th percentile bandwidth per month
*   month_95_night_half: pay by 95th percentile bandwidth with 50% off from 00:00 to 08:00.
*   hour_vas: pay by value-added services per hour
*   day_count: pay by daily requests', example='month_95'),
  endTime?: string(name='EndTime', description='The end time of the estimation.', example='2018-10-25T10:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C370DAF1-C838-4288-A1A0-9A87633D248E'),
  startTime?: string(name='StartTime', description='The start time of the estimation.', example='2018-09-30T16:00:00Z'),
}

model DescribeCdnUserBillPredictionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserBillPredictionResponseBody(name='body'),
}

/**
 * @summary Estimates resource usage of the current month.
 *
 * @description You can call this operation to estimate resource usage of the current month based on the metering method that is specified on the first day of the current month. You can call this operation to estimate resource usage only of the current month within your Alibaba Cloud account. The time range used for the estimation starts at 00:00 on the first day of the current month and ends 2 hours earlier than the current time.
 * *   Pay by monthly 95th percentile: The top 5% values between the start time and end time are excluded. The estimated value is the highest value among the remaining values.
 * *   Pay by average daily peak bandwidth per month: Estimated value = Sum of daily peak bandwidth values/Number of days. The current day is excluded.
 * *   Pay by 4th peak bandwidth per month: The estimated value is the 4th peak bandwidth value between the start time and end time. If the time range is less than four days, the estimated value is 0.
 * *   Pay by average daily 95th percentile bandwidth per month: Estimated value = Sum of daily 95th percentile bandwidth values/Number of days. The current day is excluded.
 * *   Pay by 95th percentile bandwidth with 50% off from 00:00 to 08:00: The top 5% values between the start time and end time are excluded. The estimated value is the highest value among the remaining values.
 * > You can call this operation only once per second per account.
 *
 * @param request DescribeCdnUserBillPredictionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserBillPredictionResponse
 */
async function describeCdnUserBillPredictionWithOptions(request: DescribeCdnUserBillPredictionRequest, runtime: $RuntimeOptions): DescribeCdnUserBillPredictionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.area)) {
    query['Area'] = request.area;
  }
  if (!$isNull(request.dimension)) {
    query['Dimension'] = request.dimension;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserBillPrediction',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Estimates resource usage of the current month.
 *
 * @description You can call this operation to estimate resource usage of the current month based on the metering method that is specified on the first day of the current month. You can call this operation to estimate resource usage only of the current month within your Alibaba Cloud account. The time range used for the estimation starts at 00:00 on the first day of the current month and ends 2 hours earlier than the current time.
 * *   Pay by monthly 95th percentile: The top 5% values between the start time and end time are excluded. The estimated value is the highest value among the remaining values.
 * *   Pay by average daily peak bandwidth per month: Estimated value = Sum of daily peak bandwidth values/Number of days. The current day is excluded.
 * *   Pay by 4th peak bandwidth per month: The estimated value is the 4th peak bandwidth value between the start time and end time. If the time range is less than four days, the estimated value is 0.
 * *   Pay by average daily 95th percentile bandwidth per month: Estimated value = Sum of daily 95th percentile bandwidth values/Number of days. The current day is excluded.
 * *   Pay by 95th percentile bandwidth with 50% off from 00:00 to 08:00: The top 5% values between the start time and end time are excluded. The estimated value is the highest value among the remaining values.
 * > You can call this operation only once per second per account.
 *
 * @param request DescribeCdnUserBillPredictionRequest
 * @return DescribeCdnUserBillPredictionResponse
 */
async function describeCdnUserBillPrediction(request: DescribeCdnUserBillPredictionRequest): DescribeCdnUserBillPredictionResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserBillPredictionWithOptions(request, runtime);
}

model DescribeCdnUserBillTypeRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.

This parameter is required.', example='2018-10-31T16:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The minimum data granularity is 5 minutes.

This parameter is required.', example='2018-09-30T16:00:00Z'),
}

model DescribeCdnUserBillTypeResponseBody = {
  billTypeData?: {
    billTypeDataItem?: [ 
    {
      billType?: string(name='BillType', description='The metering method.

> If the metering method is suffixed with \\\\*\\\\*_overseas\\\\*\\\\*, the billable region is outside the Chinese mainland. For example, "BillType": "month_avg_day_bandwidth_overseas" indicates that the metering method is pay by average daily peak bandwidth per month in a billable region outside the Chinese mainland.

Valid values:

*   hour_flow: pay by hourly data transfer
*   day_bandwidth: pay by daily bandwidth
*   month_95: pay by monthly 95th percentile bandwidth
*   month_avg_day_bandwidth: pay by average daily peak bandwidth per month
*   month_4th_day_bandwidth: pay by monthly 4th peak bandwidth
*   month_avg_day_95: pay by average daily 95th percentile bandwidth per month
*   month_95_night_half: pay by 95th percentile bandwidth with 50% off from 00:00 to 08:00
*   hour_vas: pay by value-added services per hour
*   quic_hour_count: pay by hourly QUIC requests
*   day_count: pay by daily requests
*   hour_count: pay by hourly requests
*   day_95: pay by daily 95th percentile bandwidth', example='month_avg_day_bandwidth_overseas'),
      billingCycle?: string(name='BillingCycle', description='The billing cycle.', example='month'),
      dimension?: string(name='Dimension', description='The dimension. Valid values:

*   flow: traffic and bandwidth
*   vas: value-added services (HTTPS and requests for dynamic content)
*   quic: the number of QUIC requests
*   websocket: the WebSocket communications protocol
*   rtlog2sls: log entries delivered to Log Service in real time
*   stationflow: traffic over the internal network', example='flow'),
      endTime?: string(name='EndTime', description='The time when the metering method ended.', example='2018-10-31T16:00:00Z'),
      product?: string(name='Product', description='The name of the product.', example='cdn'),
      startTime?: string(name='StartTime', description='The time when the metering method started.', example='2018-10-30T16:00:00Z'),
    }
  ](name='BillTypeDataItem')
  }(name='BillTypeData', description='Details about the metering methods returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C370DAF1-C838-4288-A1A0-9A87633D248E'),
}

model DescribeCdnUserBillTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserBillTypeResponseBody(name='body'),
}

/**
 * @summary Queries information about the metering methods of an account. The maximum time range to query is one month.
 *
 * @description *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnUserBillTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserBillTypeResponse
 */
async function describeCdnUserBillTypeWithOptions(request: DescribeCdnUserBillTypeRequest, runtime: $RuntimeOptions): DescribeCdnUserBillTypeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserBillType',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries information about the metering methods of an account. The maximum time range to query is one month.
 *
 * @description *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCdnUserBillTypeRequest
 * @return DescribeCdnUserBillTypeResponse
 */
async function describeCdnUserBillType(request: DescribeCdnUserBillTypeRequest): DescribeCdnUserBillTypeResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserBillTypeWithOptions(request, runtime);
}

model DescribeCdnUserConfigsRequest {
  functionName?: string(name='FunctionName', description='The configuration that you want to query. Valid values:

*   **domain_business_control**: user configurations
*   **waf**: Web Application Firewall (WAF) configurations

This parameter is required.', example='domain_business_control'),
}

model DescribeCdnUserConfigsResponseBody = {
  configs?: [ 
    {
      argName?: string(name='ArgName', description='The name of the configuration.

The configuration is specified by enterprise users and public service sectors.', example='allow_function'),
      argValue?: string(name='ArgValue', description='The value of the configuration. Valid values:

*   **cc_rule**: HTTP flood protection rules
*   **ddos_dispatch**: integration with Anti-DDoS
*   **edge_safe**: application security settings on POPs
*   **blocked_regions**: blocked regions
*   **http_acl_policy**: access control list (ACL) rules
*   **bot_manager**: bot traffic management
*   **ip_reputation**: IP reputation library', example='{\\\\"dcdn_allow\\\\":[\\\\"cc_rule\\\\",\\\\"ddos_dispatch\\\\"]}'),
      functionName?: string(name='FunctionName', description='The name of the feature.', example='domain_business_control'),
    }
  ](name='Configs', description='The user configurations.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='06D29681-B7CD-4034-A8CC-28AFFA213539'),
}

model DescribeCdnUserConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserConfigsResponseBody(name='body'),
}

/**
 * @summary Queries configurations of security features.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnUserConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserConfigsResponse
 */
async function describeCdnUserConfigsWithOptions(request: DescribeCdnUserConfigsRequest, runtime: $RuntimeOptions): DescribeCdnUserConfigsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.functionName)) {
    query['FunctionName'] = request.functionName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserConfigs',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries configurations of security features.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnUserConfigsRequest
 * @return DescribeCdnUserConfigsResponse
 */
async function describeCdnUserConfigs(request: DescribeCdnUserConfigsRequest): DescribeCdnUserConfigsResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserConfigsWithOptions(request, runtime);
}

model DescribeCdnUserDomainsByFuncRequest {
  funcId?: int32(name='FuncId', description='The ID of the feature.

For example, the ID of the origin host feature (set_req_host_header) is 18.

This parameter is required.', example='7'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Default value: **1**.

Valid values: **1** to **100000**.', example='10'),
  pageSize?: int32(name='PageSize', description='The number of domain names to return on each page. Default value: **20**.

Valid values: **1** to **50**.', example='20'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-xxxxx'),
}

model DescribeCdnUserDomainsByFuncResponseBody = {
  domains?: {
    pageData?: [ 
    {
      cdnType?: string(name='CdnType', description='The type of workload accelerated by Alibaba Cloud CDN. Valid values:

*   **web**: image and small file distribution
*   **download**: large file distribution
*   **video**: on-demand video and audio streaming
*   **liveStream**: live streaming', example='web'),
      cname?: string(name='Cname', description='The CNAME assigned to the accelerated domain name.', example='example.com.w.alikunlun.com'),
      description?: string(name='Description', description='The description of the status.', example='audit failed'),
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
      domainStatus?: string(name='DomainStatus', description='The status of the accelerated domain name. Valid values:

*   **online**: The domain name is enabled.
*   **offline**: The domain is disabled.
*   **configuring**: The endpoint group is being configured.
*   **configure_failed**: The domain failed to be configured.
*   **checking**: The domain name is under review.
*   **check_failed**: The domain name failed the review.
*   **stopping**: The domain name is be disabled.
*   **deleting**: being deleted', example='configure_failed'),
      gmtCreated?: string(name='GmtCreated', description='The time when the accelerated domain name was added to Alibaba Cloud CDN.', example='2015-10-28T11:05:52Z'),
      gmtModified?: string(name='GmtModified', description='The last time when the accelerated domain was modified.', example='2015-10-29T10:15:31Z'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-xxxxx'),
      sources?: {
        source?: [ 
        {
          content?: string(name='Content', description='The address of the origin server.', example='1.1.1.1'),
          port?: int32(name='Port', description='The port of the origin server.', example='80'),
          priority?: string(name='Priority', description='The priority of the configuration item.', example='20'),
          type?: string(name='Type', description='The type of the origin server.', example='ipaddr'),
          weight?: string(name='Weight', description='The weight of the origin server if multiple origin servers have been specified.', example='10'),
        }
      ](name='Source')
      }(name='Sources', description='The information about the origin server.'),
      sslProtocol?: string(name='SslProtocol', description='Indicates whether HTTPS is enabled. Valid values:

*   **on**
*   **off**', example='on'),
    }
  ](name='PageData')
  }(name='Domains', description='The configurations of the accelerated domain name.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='5'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AA75AADB-5E25-4970-B480-EAA1F5658483'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='16'),
}

model DescribeCdnUserDomainsByFuncResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserDomainsByFuncResponseBody(name='body'),
}

/**
 * @summary Queries accelerated domain names that have specified features configured and the status of the domain names.
 *
 * @description >  The maximum number of times that each user can call this operation per second is 100.
 *
 * @param request DescribeCdnUserDomainsByFuncRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserDomainsByFuncResponse
 */
async function describeCdnUserDomainsByFuncWithOptions(request: DescribeCdnUserDomainsByFuncRequest, runtime: $RuntimeOptions): DescribeCdnUserDomainsByFuncResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.funcId)) {
    query['FuncId'] = request.funcId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserDomainsByFunc',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries accelerated domain names that have specified features configured and the status of the domain names.
 *
 * @description >  The maximum number of times that each user can call this operation per second is 100.
 *
 * @param request DescribeCdnUserDomainsByFuncRequest
 * @return DescribeCdnUserDomainsByFuncResponse
 */
async function describeCdnUserDomainsByFunc(request: DescribeCdnUserDomainsByFuncRequest): DescribeCdnUserDomainsByFuncResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserDomainsByFuncWithOptions(request, runtime);
}

model DescribeCdnUserQuotaRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeCdnUserQuotaResponseBody = {
  blockQuota?: int32(name='BlockQuota', description='The maximum number of URLs and directories that can be blocked.', example='100'),
  blockRemain?: int32(name='BlockRemain', description='The remaining number of URLs and directories that can be blocked.', example='100'),
  domainQuota?: int32(name='DomainQuota', description='The maximum number of accelerated domain names.', example='50'),
  ignoreParamsQuota?: int32(name='IgnoreParamsQuota', description='The maximum number of ignore params that can be refreshed.', example='100'),
  ignoreParamsRemain?: int32(name='IgnoreParamsRemain', description='The remaining number of ignore params that can be refreshed.', example='10'),
  preloadQuota?: int32(name='PreloadQuota', description='The maximum number of URLs that can be prefetched.', example='500'),
  preloadRemain?: int32(name='PreloadRemain', description='The remaining number of URLs that can be prefetched.', example='100'),
  refreshDirQuota?: int32(name='RefreshDirQuota', description='The maximum number of directories that can be refreshed.', example='100'),
  refreshDirRemain?: int32(name='RefreshDirRemain', description='The remaining number of directories that can be refreshed.', example='500'),
  refreshUrlQuota?: int32(name='RefreshUrlQuota', description='The maximum number of URLs that can be refreshed.', example='2000'),
  refreshUrlRemain?: int32(name='RefreshUrlRemain', description='The remaining number of URLs that can be refreshed.', example='2000'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EF4F084A-2F49-4E1C-9CA0-DC85BCE7F391'),
}

model DescribeCdnUserQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserQuotaResponseBody(name='body'),
}

/**
 * @summary Queries the quotas and usage of Alibaba Cloud CDN resources.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnUserQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserQuotaResponse
 */
async function describeCdnUserQuotaWithOptions(request: DescribeCdnUserQuotaRequest, runtime: $RuntimeOptions): DescribeCdnUserQuotaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserQuota',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the quotas and usage of Alibaba Cloud CDN resources.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnUserQuotaRequest
 * @return DescribeCdnUserQuotaResponse
 */
async function describeCdnUserQuota(request: DescribeCdnUserQuotaRequest): DescribeCdnUserQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserQuotaWithOptions(request, runtime);
}

model DescribeCdnUserResourcePackageRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
  status?: string(name='Status', description='The status of the resource plan that you want to query. Valid values:

*   **valid**: valid
*   **closed**: expired', example='valid'),
}

model DescribeCdnUserResourcePackageResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='84839536-2B7E-457D-9D8C-82E6C7D4E1A3'),
  resourcePackageInfos?: {
    resourcePackageInfo?: [ 
    {
      commodityCode?: string(name='CommodityCode', description='The ID of the resource plan.', example='cdnflowbag'),
      currCapacity?: string(name='CurrCapacity', description='The remaining quota of the resource plan.

*   For a data transfer plan, the quota is measured in bytes.
*   For a request resource plan, the quota is measured in the number of requests.', example='10995089554629'),
      displayName?: string(name='DisplayName', description='The name of the resource plan.', example='CDN data transfer plan (Chinese mainland)'),
      endTime?: string(name='EndTime', description='The expiration time.', example='2018-07-01T08:00:00Z'),
      initCapacity?: string(name='InitCapacity', description='The total quota of the resource plan.

*   For a data transfer plan, the quota is measured in bytes.
*   For a request resource plan, the quota is measured in the number of requests.', example='536870912000'),
      instanceId?: string(name='InstanceId', description='The ID of the instance', example='FP-ilttxc23a'),
      startTime?: string(name='StartTime', description='The effective time.', example='2017-12-05T19:10:58Z'),
      status?: string(name='Status', description='The status of the resource plan. Valid values:

*   **valid**: valid
*   **closed**: expired', example='valid'),
      templateName?: string(name='TemplateName', description='The name of the template.', example='CDN data transfer plan'),
    }
  ](name='ResourcePackageInfo')
  }(name='ResourcePackageInfos', description='The detailed information about resource plans. The returned information is displayed in an array of ResourcePackageInfo nodes.'),
}

model DescribeCdnUserResourcePackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnUserResourcePackageResponseBody(name='body'),
}

/**
 * @summary Queries the resource plans that you have purchased for Alibaba Cloud CDN.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnUserResourcePackageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnUserResourcePackageResponse
 */
async function describeCdnUserResourcePackageWithOptions(request: DescribeCdnUserResourcePackageRequest, runtime: $RuntimeOptions): DescribeCdnUserResourcePackageResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnUserResourcePackage',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the resource plans that you have purchased for Alibaba Cloud CDN.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeCdnUserResourcePackageRequest
 * @return DescribeCdnUserResourcePackageResponse
 */
async function describeCdnUserResourcePackage(request: DescribeCdnUserResourcePackageRequest): DescribeCdnUserResourcePackageResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnUserResourcePackageWithOptions(request, runtime);
}

model DescribeCdnWafDomainRequest {
  domainName?: string(name='DomainName', description='The domain name that you want to query.

You can specify only one domain name in each request. You have three options to configure this parameter:

*   Specify an exact domain name. For example, if you set this parameter to example.com, configuration information of example.com is queried.
*   Specify a keyword. For example, if you set this parameter to example, configuration information about all domain names that contain example is queried.
*   Leave this parameter empty. If this parameter is left empty, all accelerated domain names for which WAF is configured are queried.', example='example.com'),
  regionId?: string(name='RegionId', description='The region where WAF is enabled. Valid values:

*   **cn-hangzhou**: inside the Chinese mainland
*   **ap-southeast-1**: outside the Chinese mainland

> ap-southeast-1 includes Hong Kong (China), Macao (China), Taiwan (China), and other countries and regions.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='1234'),
}

model DescribeCdnWafDomainResponseBody = {
  outPutDomains?: [ 
    {
      aclStatus?: string(name='AclStatus', description='The status of the access control list (ACL) feature. Valid values:

*   **0**: disabled
*   **1**: enabled', example='1'),
      ccStatus?: string(name='CcStatus', description='The status of protection against HTTP flood attacks. Valid values:

*   **0**: disabled
*   **1**: enabled', example='1'),
      domain?: string(name='Domain', description='The accelerated domain name.', example='example.com'),
      status?: string(name='Status', description='The WAF status of the domain name. Valid values:

*   **1**: The domain name is added to WAF or valid.
*   **10**: The domain name is being added to WAF.
*   **11**: The domain name failed to be added to WAF.', example='1'),
      wafStatus?: string(name='WafStatus', description='The status of WAF. Valid values:

*   **0**: disabled
*   **1**: enabled', example='1'),
    }
  ](name='OutPutDomains', description='The information about the accelerated domain name.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CB1A380B-09F0-41BB-802B-72F8FD6DA2FE'),
  totalCount?: int32(name='TotalCount', description='The number of accelerated domain names.', example='1'),
}

model DescribeCdnWafDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdnWafDomainResponseBody(name='body'),
}

/**
 * @summary Queries domain names that use Web Application Firewall (WAF).
 *
 * @description > You can call this operation up to 150 times per second per account.
 *
 * @param request DescribeCdnWafDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdnWafDomainResponse
 */
async function describeCdnWafDomainWithOptions(request: DescribeCdnWafDomainRequest, runtime: $RuntimeOptions): DescribeCdnWafDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdnWafDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries domain names that use Web Application Firewall (WAF).
 *
 * @description > You can call this operation up to 150 times per second per account.
 *
 * @param request DescribeCdnWafDomainRequest
 * @return DescribeCdnWafDomainResponse
 */
async function describeCdnWafDomain(request: DescribeCdnWafDomainRequest): DescribeCdnWafDomainResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdnWafDomainWithOptions(request, runtime);
}

model DescribeCertificateInfoByIDRequest {
  certId?: string(name='CertId', description='The ID of the certificate. You can query only one certificate in each call.

This parameter is required.', example='1644xx'),
}

model DescribeCertificateInfoByIDResponseBody = {
  certInfos?: {
    certInfo?: [ 
    {
      certExpireTime?: string(name='CertExpireTime', description='The time at which the certificate expires.', example='2098-02-08 08:02:07 +0000 UTC'),
      certId?: string(name='CertId', description='The ID of the certificate.', example='1644xx'),
      certName?: string(name='CertName', description='The name of the certificate.', example='example_cert'),
      certType?: string(name='CertType', description='The type of the certificate.

*   free: a free certificate
*   cas: a certificate purchased by using Certificate Management Service
*   upload: a user-uploaded certificate', example='cas'),
      createTime?: string(name='CreateTime', description='The time when the certificate became effective.', example='2015-12-21 08:02:07 +0000 UTC'),
      domainList?: string(name='DomainList', description='The domain names that use the certificate.', example='["example.com"]'),
      httpsCrt?: string(name='HttpsCrt', description='The content of the certificate.', example='-----BEGIN CERTIFICATE-----\\\\nxxx-----END CERTIFICATE-----\\\\n'),
    }
  ](name='CertInfo')
  }(name='CertInfos', description='The information about the certificate.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5C1E43DC-9E51-4771-82C0-7D5ECEB547A1'),
}

model DescribeCertificateInfoByIDResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCertificateInfoByIDResponseBody(name='body'),
}

/**
 * @summary Queries the information about a specific certificate by certificate ID.
 *
 * @description *   You can call this operation up to 100 times per second per account.
 * *   If a certificate is associated with a domain name but the certificate is not enabled, the result of this operation shows that the certificate does not exist.
 *
 * @param request DescribeCertificateInfoByIDRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCertificateInfoByIDResponse
 */
async function describeCertificateInfoByIDWithOptions(request: DescribeCertificateInfoByIDRequest, runtime: $RuntimeOptions): DescribeCertificateInfoByIDResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCertificateInfoByID',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about a specific certificate by certificate ID.
 *
 * @description *   You can call this operation up to 100 times per second per account.
 * *   If a certificate is associated with a domain name but the certificate is not enabled, the result of this operation shows that the certificate does not exist.
 *
 * @param request DescribeCertificateInfoByIDRequest
 * @return DescribeCertificateInfoByIDResponse
 */
async function describeCertificateInfoByID(request: DescribeCertificateInfoByIDRequest): DescribeCertificateInfoByIDResponse {
  var runtime = new $RuntimeOptions{};
  return describeCertificateInfoByIDWithOptions(request, runtime);
}

model DescribeCustomDomainSampleRateRequest {
  domainName?: string(name='DomainName'),
}

model DescribeCustomDomainSampleRateResponseBody = {
  content?: {
    domainContent?: [ 
    {
      domainName?: string(name='DomainName'),
      sampleRate?: float(name='SampleRate'),
    }
  ](name='DomainContent')
  }(name='Content'),
  requestId?: string(name='RequestId'),
}

model DescribeCustomDomainSampleRateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomDomainSampleRateResponseBody(name='body'),
}

/**
 * @summary A客户定制查询域名采样率
 *
 * @param request DescribeCustomDomainSampleRateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomDomainSampleRateResponse
 */
async function describeCustomDomainSampleRateWithOptions(request: DescribeCustomDomainSampleRateRequest, runtime: $RuntimeOptions): DescribeCustomDomainSampleRateResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCustomDomainSampleRate',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary A客户定制查询域名采样率
 *
 * @param request DescribeCustomDomainSampleRateRequest
 * @return DescribeCustomDomainSampleRateResponse
 */
async function describeCustomDomainSampleRate(request: DescribeCustomDomainSampleRateRequest): DescribeCustomDomainSampleRateResponse {
  var runtime = new $RuntimeOptions{};
  return describeCustomDomainSampleRateWithOptions(request, runtime);
}

model DescribeCustomLogConfigRequest {
  configId?: string(name='ConfigId', description='The ID of the custom configuration.

This parameter is required.', example='123'),
}

model DescribeCustomLogConfigResponseBody = {
  remark?: string(name='Remark', description='The format of the log configuration.', example='$time_iso8601_$request_method_$'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='94E3559F-7B6A-4A5E-AFFD-44E2A208A249'),
  sample?: string(name='Sample', description='The sample.', example='"[9/Jun/2015:01:58:09 +0800] 188.165.15.75 - 1542 \\\\"-\\\\" \\\\"GEThttp: //www.aliyun.com/index.html\\\\" 200'),
  tag?: string(name='Tag', description='The tag information about the log configuration.', example='img1'),
}

model DescribeCustomLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomLogConfigResponseBody(name='body'),
}

/**
 * @summary Queries the details about a custom logging configuration.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCustomLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomLogConfigResponse
 */
async function describeCustomLogConfigWithOptions(request: DescribeCustomLogConfigRequest, runtime: $RuntimeOptions): DescribeCustomLogConfigResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCustomLogConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about a custom logging configuration.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeCustomLogConfigRequest
 * @return DescribeCustomLogConfigResponse
 */
async function describeCustomLogConfig(request: DescribeCustomLogConfigRequest): DescribeCustomLogConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeCustomLogConfigWithOptions(request, runtime);
}

model DescribeDomainAverageResponseTimeRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

By default, this operation queries the geographic distribution of users for all accelerated domain names.', example='example.com'),
  domainType?: string(name='DomainType', description='The type of the query condition. When you set the value to dynamic, this operation queries the average response time of dynamic resources and static resources. If you do not set this parameter, this operation queries the average response time of only static resources.', example='domaintype'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  interval?: string(name='Interval', description='The time interval between the data entries. Unit: seconds. The value varies based on the values of the **StartTime** and **EndTime** parameters. Valid values:

*   If the time span between StartTime and EndTime is less than 3 days, valid values are **300**, **3600**, and **86400**. Default value: **300**.
*   If the time span between StartTime and EndTime is greater than or equal to 3 days and less than 31 days, valid values are **3600** and **86400**. Default value: **3600**.
*   If the time range between StartTime and EndTime is 31 days or longer, the valid value is **86400**. Default value: **86400**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP) for your Alibaba Cloud CDN service. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs. If you do not set this parameter, data of all ISPs is queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions. If you do not set this parameter, data in all regions is queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:33:00Z'),
  timeMerge?: string(name='TimeMerge', description='Specifies whether to automatically set the interval. If you set the value to 1, the value of the Interval parameter is automatically assigned based on the StartTime and EndTime parameters. You can set this parameter or the Interval parameter.', example='1'),
}

model DescribeDomainAverageResponseTimeResponseBody = {
  avgRTPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2015-12-10T20:00:00Z'),
      value?: string(name='Value', description='The average response time.', example='3'),
    }
  ](name='DataModule')
  }(name='AvgRTPerInterval', description='The average response time data for time intervals.'),
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-30T05:40:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainAverageResponseTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainAverageResponseTimeResponseBody(name='body'),
}

/**
 * @summary Queries the average response time of one or more accelerated domain names. You can query data collected within the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature to for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can call this operation up to 100 times per second per account.
 * >*   You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).
 *
 * @param request DescribeDomainAverageResponseTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainAverageResponseTimeResponse
 */
async function describeDomainAverageResponseTimeWithOptions(request: DescribeDomainAverageResponseTimeRequest, runtime: $RuntimeOptions): DescribeDomainAverageResponseTimeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.domainType)) {
    query['DomainType'] = request.domainType;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.timeMerge)) {
    query['TimeMerge'] = request.timeMerge;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainAverageResponseTime',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the average response time of one or more accelerated domain names. You can query data collected within the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature to for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can call this operation up to 100 times per second per account.
 * >*   You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).
 *
 * @param request DescribeDomainAverageResponseTimeRequest
 * @return DescribeDomainAverageResponseTimeResponse
 */
async function describeDomainAverageResponseTime(request: DescribeDomainAverageResponseTimeRequest): DescribeDomainAverageResponseTimeResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainAverageResponseTimeWithOptions(request, runtime);
}

model DescribeDomainBpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries bandwidth data for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2020-05-14T10:00:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISP names.

If you do not set this parameter, data of all ISPs is queried.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.

If you do not specify a region, data in all regions is queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-05-14T09:50:00Z'),
}

model DescribeDomainBpsDataResponseBody = {
  bpsDataPerInterval?: {
    dataModule?: [ 
    {
      domesticValue?: string(name='DomesticValue', description='The bandwidth value in the Chinese mainland. When the bandwidth data is queried by ISP, this parameter is empty.', example='11286111'),
      httpsDomesticValue?: string(name='HttpsDomesticValue', description='The bandwidth data for HTTPS requests in the Chinese mainland. When the bandwidth data is queried by ISP, this parameter is empty.', example='11286111'),
      httpsOverseasValue?: string(name='HttpsOverseasValue', description='The bandwidth data for HTTPS requests in regions outside the Chinese mainland. When the bandwidth data is queried by ISP, this parameter is empty.', example='2000'),
      httpsValue?: string(name='HttpsValue', description='The bandwidth value for HTTPS requests. Unit: bit/s.', example='11288111'),
      overseasValue?: string(name='OverseasValue', description='The bandwidth data in regions outside the Chinese mainland. When the bandwidth data is queried by ISP, this parameter is empty.', example='2000'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2015-12-10T20:00:00Z'),
      value?: string(name='Value', description='The bandwidth. Unit: bit/s.', example='11288111'),
    }
  ](name='DataModule')
  }(name='BpsDataPerInterval', description='The list of bandwidth data entries returned at each interval.'),
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-12-10T20:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the ISP.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region.', example='beijing'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2020-05-14T09:50:00Z'),
}

model DescribeDomainBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries bandwidth monitoring data for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 150 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainBpsDataResponse
 */
async function describeDomainBpsDataWithOptions(request: DescribeDomainBpsDataRequest, runtime: $RuntimeOptions): DescribeDomainBpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainBpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries bandwidth monitoring data for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 150 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainBpsDataRequest
 * @return DescribeDomainBpsDataResponse
 */
async function describeDomainBpsData(request: DescribeDomainBpsDataRequest): DescribeDomainBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainBpsDataWithOptions(request, runtime);
}

model DescribeDomainBpsDataByLayerRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

> If you do not specify this parameter, the bandwidth data about all accelerated domain names that belong to your Alibaba Cloud account is queried.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2020-05-06T07:20:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](~~DescribeCdnRegionAndIsp~~) operation to query ISPs. If you do not specify an ISP, data of all ISPs is queried.', example='unicom'),
  layer?: string(name='Layer', description='The layer at which you want to query the bandwidth data. Valid values:

*   Network layer: **IPv4** and **IPv6**.
*   Application layer: **http**, **https**, and **quic**.
*   **all**: specifies that both the network and application layers are included.

Default value: **all**.', example='IPv4'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](~~DescribeCdnRegionAndIsp~~) operation to query regions. If you do not specify a region, data in all regions is queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-05-06T07:10:00Z'),
}

model DescribeDomainBpsDataByLayerResponseBody = {
  bpsDataInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2020-05-06T07:10:00Z'),
      trafficValue?: string(name='TrafficValue', description='The total amount of network traffic. Unit: bytes.', example='2838'),
      value?: string(name='Value', description='The peak bandwidth value. Unit: bit/s.', example='75.68'),
    }
  ](name='DataModule')
  }(name='BpsDataInterval', description='The data returned at each time interval.'),
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries. Unit: seconds.', example='300'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C565B910-BC3B-467B-9046-2A48566EA967'),
}

model DescribeDomainBpsDataByLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainBpsDataByLayerResponseBody(name='body'),
}

/**
 * @summary Queries bandwidth data by protocol.
 *
 * @description * You can call this operation up to 20 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainBpsDataByLayerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainBpsDataByLayerResponse
 */
async function describeDomainBpsDataByLayerWithOptions(request: DescribeDomainBpsDataByLayerRequest, runtime: $RuntimeOptions): DescribeDomainBpsDataByLayerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.layer)) {
    query['Layer'] = request.layer;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainBpsDataByLayer',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries bandwidth data by protocol.
 *
 * @description * You can call this operation up to 20 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainBpsDataByLayerRequest
 * @return DescribeDomainBpsDataByLayerResponse
 */
async function describeDomainBpsDataByLayer(request: DescribeDomainBpsDataByLayerRequest): DescribeDomainBpsDataByLayerResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainBpsDataByLayerWithOptions(request, runtime);
}

model DescribeDomainBpsDataByTimeStampRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  ispNames?: string(name='IspNames', description='The names of the Internet service providers (ISPs). Separate multiple ISPs with commas (,).

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.

This parameter is required.', example='uni***,tele***'),
  locationNames?: string(name='LocationNames', description='The regions. Separate multiple regions with commas (,).

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.

This parameter is required.', example='liaoning,guangxi'),
  timePoint?: string(name='TimePoint', description='The point in time to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The data is collected every 5 minutes.

This parameter is required.', example='2019-11-30T05:40:00Z'),
}

model DescribeDomainBpsDataByTimeStampResponseBody = {
  bpsDataList?: {
    bpsDataModel?: [ 
    {
      bps?: long(name='Bps', description='The bandwidth value.', example='52119553'),
      ispName?: string(name='IspName', description='The name of the ISP.', example='unicom'),
      locationName?: string(name='LocationName', description='The name of the region.', example='Liaoning'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2019-11-30T05:40:00Z'),
    }
  ](name='BpsDataModel')
  }(name='BpsDataList', description='A list of bandwidth values by ISP and region.'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
  timeStamp?: string(name='TimeStamp', description='The point in time.', example='2019-11-30T05:40:00Z'),
}

model DescribeDomainBpsDataByTimeStampResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainBpsDataByTimeStampResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth data at a specified time for an accelerated domain.
 *
 * @description *   The bandwidth is measured in bit/s.
 * *   You can specify only one accelerated domain name in each request.
 * *   The data is collected every 5 minutes.
 * *   You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeDomainBpsDataByTimeStampRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainBpsDataByTimeStampResponse
 */
async function describeDomainBpsDataByTimeStampWithOptions(request: DescribeDomainBpsDataByTimeStampRequest, runtime: $RuntimeOptions): DescribeDomainBpsDataByTimeStampResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ispNames)) {
    query['IspNames'] = request.ispNames;
  }
  if (!$isNull(request.locationNames)) {
    query['LocationNames'] = request.locationNames;
  }
  if (!$isNull(request.timePoint)) {
    query['TimePoint'] = request.timePoint;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainBpsDataByTimeStamp',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the bandwidth data at a specified time for an accelerated domain.
 *
 * @description *   The bandwidth is measured in bit/s.
 * *   You can specify only one accelerated domain name in each request.
 * *   The data is collected every 5 minutes.
 * *   You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeDomainBpsDataByTimeStampRequest
 * @return DescribeDomainBpsDataByTimeStampResponse
 */
async function describeDomainBpsDataByTimeStamp(request: DescribeDomainBpsDataByTimeStampRequest): DescribeDomainBpsDataByTimeStampResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainBpsDataByTimeStampWithOptions(request, runtime);
}

model DescribeDomainCcActivityLogRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify multiple domain names and separate them with commas (,).

If you do not specify this parameter, data of all accelerated domain names under your account is queried.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2018-12-10T21:00:00Z'),
  pageNumber?: long(name='PageNumber', description='The page number of the page to return. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Default value: **30**.', example='30'),
  ruleName?: string(name='RuleName', description='A custom rule name. Valid values:

*   default_normal: rule for the normal mode
*   default_attack: rule for the emergency mode

If you leave this parameter empty, events that triggered rate limiting based on all rules are queried.', example='test2'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The minimum time granularity of data collection is 5 minutes.

If you leave this parameter empty, the data collected over the last 24 hours is queried.', example='2018-12-10T20:00:00Z'),
  triggerObject?: string(name='TriggerObject', description='The trigger of rate limiting by which you want to query data.

If you leave this parameter empty, all events that triggered rate limiting are queried.', example='IP'),
  value?: string(name='Value', description='The value of the trigger.

If you leave this parameter empty, all events recorded for the trigger are queried.', example='1.2.3.4'),
}

model DescribeDomainCcActivityLogResponseBody = {
  activityLog?: [ 
    {
      action?: string(name='Action', description='The action that was triggered.', example='deny'),
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
      ruleName?: string(name='RuleName', description='The name of the rule based on which rate limiting was triggered.', example='test'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2015-12-10T20:00:00Z'),
      triggerObject?: string(name='TriggerObject', description='The trigger of rate limiting.', example='Ip'),
      ttl?: long(name='Ttl', description='The period of time during which rate limiting remains effective.', example='300'),
      value?: string(name='Value', description='The value of the trigger for rate limiting.', example='1.2.3.4'),
    }
  ](name='ActivityLog', description='The list of rate limiting logs.'),
  pageIndex?: long(name='PageIndex', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
  total?: long(name='Total', description='The total number of entries returned.', example='20'),
}

model DescribeDomainCcActivityLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainCcActivityLogResponseBody(name='body'),
}

/**
 * @summary Queries log entries of rate limiting.
 *
 * @description *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range. You must set both parameters or leave both parameters empty.
 * *   You can specify up to 20 domain names in reach request. If you specify multiple domain names, separate them with commas (,).
 * *   You can query data collected over the last 30 days.
 * *   You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeDomainCcActivityLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainCcActivityLogResponse
 */
async function describeDomainCcActivityLogWithOptions(request: DescribeDomainCcActivityLogRequest, runtime: $RuntimeOptions): DescribeDomainCcActivityLogResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.triggerObject)) {
    query['TriggerObject'] = request.triggerObject;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainCcActivityLog',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries log entries of rate limiting.
 *
 * @description *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range. You must set both parameters or leave both parameters empty.
 * *   You can specify up to 20 domain names in reach request. If you specify multiple domain names, separate them with commas (,).
 * *   You can query data collected over the last 30 days.
 * *   You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeDomainCcActivityLogRequest
 * @return DescribeDomainCcActivityLogResponse
 */
async function describeDomainCcActivityLog(request: DescribeDomainCcActivityLogRequest): DescribeDomainCcActivityLogResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainCcActivityLogWithOptions(request, runtime);
}

model DescribeDomainCertificateInfoRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
}

model DescribeDomainCertificateInfoResponseBody = {
  certInfos?: {
    certInfo?: [ 
    {
      certDomainName?: string(name='CertDomainName', description='The domain name that matches the certificate.', example='example.com'),
      certExpireTime?: string(name='CertExpireTime', description='The time at which the certificate expires.', example='2018-06-03T22:03:39Z'),
      certId?: string(name='CertId', description='The ID of the certificate.', example='9002448'),
      certLife?: string(name='CertLife', description='The unit of the validity period of the certificate. Valid values:

*   **months**
*   **years**', example='months'),
      certName?: string(name='CertName', description='The name of the certificate.', example='example.com'),
      certOrg?: string(name='CertOrg', description='The name of the certificate authority (CA) that issued the certificate.', example='Let\\\\"s Encrypt'),
      certRegion?: string(name='CertRegion', description='The region where the certificate is used.', example='cn-hangzhou'),
      certStartTime?: string(name='CertStartTime', description='The time when the certificate became effective.', example='2018-06-03T22:03:39Z'),
      certType?: string(name='CertType', description='The type of the certificate.

*   **free**: a free certificate
*   **cas**: a certificate that is purchased by using Certificate Management Service
*   **upload**: a custom certificate that you upload', example='free'),
      certUpdateTime?: string(name='CertUpdateTime', description='The time at which the certificate was updated.', example='2018-06-03T22:03:39Z'),
      domainCnameStatus?: string(name='DomainCnameStatus', description='The CNAME status of the domain name.

*   **ok**: The domain name points to the CNAME assigned by Alibaba Cloud CDN.
*   **cname_error**: An error occurred and the domain name cannot point to the CNAME.
*   **op_domain_cname_error** : An error occurred to the CNAME of the top-level domain. The domain name cannot point to the CNAME.
*   **unsupport_wildcard**: The wildcard domain name is not supported.', example='ok'),
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
      serverCertificate?: string(name='ServerCertificate', description='The public key of the certificate.', example='asdadaxxxx'),
      serverCertificateStatus?: string(name='ServerCertificateStatus', description='The status of HTTPS.

*   **on**
*   **off**', example='on'),
      status?: string(name='Status', description='The status of the certificate. Valid values:

*   **success**: The certificate has taken effect.
*   **checking**: The system is checking whether the domain name is using Alibaba Cloud CDN.
*   **cname_error**: No valid CNAME record has been added for the domain name.
*   **top_domain_cname_error**: No valid CNAME record has been added for the top-level domain.
*   **domain_invalid**: The domain name contains invalid characters.
*   **unsupport_wildcard**: The domain name is a wildcard domain name. Wildcard domain names are not supported.
*   **applying**: The certificate application is in progress.
*   **get_token_timeout**: The certificate application request has timed out.
*   **check_token_timeout**: The verification has timed out.
*   **get_cert_timeout**: The request to obtain the certificate has timed out.
*   **failed**: The certificate application request failed.', example='success'),
    }
  ](name='CertInfo')
  }(name='CertInfos', description='The information about the certificate.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5C1E43DC-9E51-4771-82C0-7D5ECEB547A1'),
}

model DescribeDomainCertificateInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainCertificateInfoResponseBody(name='body'),
}

/**
 * @summary Queries the certificate information of an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainCertificateInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainCertificateInfoResponse
 */
async function describeDomainCertificateInfoWithOptions(request: DescribeDomainCertificateInfoRequest, runtime: $RuntimeOptions): DescribeDomainCertificateInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainCertificateInfo',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the certificate information of an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainCertificateInfoRequest
 * @return DescribeDomainCertificateInfoResponse
 */
async function describeDomainCertificateInfo(request: DescribeDomainCertificateInfoRequest): DescribeDomainCertificateInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainCertificateInfoWithOptions(request, runtime);
}

model DescribeDomainCnameRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name that you want to query. Separate multiple domain names with commas (,). This parameter cannot be left empty.

This parameter is required.', example='pay.slci6c.mbolsos.com,mch.b7r2v7.mbolsos.com,p.h99e.mbolsos.com,p.xmko.mbolsos.com,p.f2kd.mbolsos.com'),
}

model DescribeDomainCnameResponseBody = {
  cnameDatas?: {
    data?: [ 
    {
      cname?: string(name='Cname', description='The CNAME assigned to the domain name by Alibaba Cloud CDN.', example='a.com.w.alikunlun.net'),
      domain?: string(name='Domain', description='The accelerated domain name.', example='a.com'),
      status?: int32(name='Status', description='The CNAME detection result. Valid values:

*   0: The DNS can detect the CNAME assigned to the domain name.
*   Value other than 0: The DNS cannot detect the CNAME assigned to the domain name.', example='0'),
    }
  ](name='Data')
  }(name='CnameDatas', description='Details about the CNAME detection results.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='06D29681-B7CD-4034-A8CC-28AFFA213539'),
}

model DescribeDomainCnameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainCnameResponseBody(name='body'),
}

/**
 * @summary Detects the CNAME for an accelerated domain name. You can check the resolution result to determine whether the CNAME is configured.
 *
 * @param request DescribeDomainCnameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainCnameResponse
 */
async function describeDomainCnameWithOptions(request: DescribeDomainCnameRequest, runtime: $RuntimeOptions): DescribeDomainCnameResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainCname',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Detects the CNAME for an accelerated domain name. You can check the resolution result to determine whether the CNAME is configured.
 *
 * @param request DescribeDomainCnameRequest
 * @return DescribeDomainCnameResponse
 */
async function describeDomainCname(request: DescribeDomainCnameRequest): DescribeDomainCnameResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainCnameWithOptions(request, runtime);
}

model DescribeDomainCustomLogConfigRequest {
  domainName?: string(name='DomainName', description='The domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
}

model DescribeDomainCustomLogConfigResponseBody = {
  configId?: string(name='ConfigId', description='The ID of the log configuration.', example='123'),
  remark?: string(name='Remark', description='The format of the log configuration.', example='$time_iso8601_$request_method_$'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='94E3559F-7B6A-4A5E-AFFD-44E2A208A249'),
  sample?: string(name='Sample', description='The sample log configuration.', example='[9/Jun/2015:01:58:09+0800]188.165.15.75-1542\\\\"-\\\\"\\\\"GET http://www.aliyun.com/index.html\\\\'),
  tag?: string(name='Tag', description='The tag information about the log configuration.', example='book'),
}

model DescribeDomainCustomLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainCustomLogConfigResponseBody(name='body'),
}

/**
 * @summary Queries the custom log configuration of an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainCustomLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainCustomLogConfigResponse
 */
async function describeDomainCustomLogConfigWithOptions(request: DescribeDomainCustomLogConfigRequest, runtime: $RuntimeOptions): DescribeDomainCustomLogConfigResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainCustomLogConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the custom log configuration of an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainCustomLogConfigRequest
 * @return DescribeDomainCustomLogConfigResponse
 */
async function describeDomainCustomLogConfig(request: DescribeDomainCustomLogConfigRequest): DescribeDomainCustomLogConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainCustomLogConfigWithOptions(request, runtime);
}

model DescribeDomainDetailDataByLayerRequest {
  domainName?: string(name='DomainName', description='The name of the Internet service provider (ISP) for your Alibaba Cloud CDN service. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISP names.

If you do not specify an ISP, data of all ISPs is queried.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The protocol by which you want to query data. Valid values: **http**, **https**, **quic**, and **all**.

The default value is **all**.

This parameter is required.', example='2020-07-05T22:05:00Z'),
  field?: string(name='Field', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.

This parameter is required.', example='bps,ipv6_traf,traf,http_code,qps'),
  ispNameEn?: string(name='IspNameEn', description='The ID of the request.', example='telecom'),
  layer?: string(name='Layer', description='The amount of network traffic. Unit: bytes.', example='all'),
  locationNameEn?: string(name='LocationNameEn', description='The detailed data of the accelerated domain names.', example='hangzhou'),
  startTime?: string(name='StartTime', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.

If you do not specify a region, data in all regions is queried.

This parameter is required.', example='2020-07-05T22:00:00Z'),
}

model DescribeDomainDetailDataByLayerResponseBody = {
  data?: {
    dataModule?: [ 
    {
      acc?: long(name='Acc', description='The timestamp of the data returned.', example='2'),
      bps?: float(name='Bps', description='The bandwidth of IPv6 requests. Unit: bit/s.', example='21060178715.146667'),
      domainName?: string(name='DomainName', description='The number of requests.', example='example.com'),
      httpCode?: string(name='HttpCode', description='- You can call this operation up to 20 times per second per account.
- If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.

**Time granularity**

The following table describes the time granularity, the time period within which historical data is available, and the data delay, which vary with the maximum time range per query. 

| Time granularity | Maximum time range per query | Historical data available | Data delay |
| ---------------- | ---------------------------- | ------------------------- | ---------- |
| 5 minutes | 3 days | 93 days | 15 minutes |
| 1 hour | 31 days | 186 days | 4 hours |
| 1 days | 366 days | 366 days | 04:00 on the next day |', example='200:44349|206:1753719|304:45|403:1095|416:1|499:332'),
      ipv6Acc?: long(name='Ipv6Acc', description='The bandwidth. Unit: bit/s.', example='1'),
      ipv6Bps?: float(name='Ipv6Bps', description='The number of IPv6 requests.', example='0'),
      ipv6Qps?: float(name='Ipv6Qps', description='The amount of network traffic generated by IPv6 requests. Unit: bytes.', example='0'),
      ipv6Traf?: long(name='Ipv6Traf', description='The proportions of HTTP status codes.', example='141718944482'),
      qps?: float(name='Qps', description='The number of requests.', example='5998.47'),
      timeStamp?: string(name='TimeStamp', description='The domain name.', example='2020-07-05T22:00:00Z'),
      traf?: long(name='Traf', description='The bandwidth of IPv6 requests. Unit: bit/s.', example='789756701818'),
    }
  ](name='DataModule')
  }(name='Data', description='The number of IPv6 requests per second.'),
  requestId?: string(name='RequestId', description='The number of queries per second.', example='BEA5625F-8FCF-48F4-851B-CA63946DA664'),
}

model DescribeDomainDetailDataByLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainDetailDataByLayerResponseBody(name='body'),
}

/**
 * @summary The domain name that you want to query. You can specify multiple domain names and separate them with commas (,). You can specify at most 30 domain names in each call.
 *
 * @description You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeDomainDetailDataByLayerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainDetailDataByLayerResponse
 */
async function describeDomainDetailDataByLayerWithOptions(request: DescribeDomainDetailDataByLayerRequest, runtime: $RuntimeOptions): DescribeDomainDetailDataByLayerResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainDetailDataByLayer',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The domain name that you want to query. You can specify multiple domain names and separate them with commas (,). You can specify at most 30 domain names in each call.
 *
 * @description You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeDomainDetailDataByLayerRequest
 * @return DescribeDomainDetailDataByLayerResponse
 */
async function describeDomainDetailDataByLayer(request: DescribeDomainDetailDataByLayerRequest): DescribeDomainDetailDataByLayerResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainDetailDataByLayerWithOptions(request, runtime);
}

model DescribeDomainHitRateDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries the byte hit ratios for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-30T08:10:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-30T08:00:00Z'),
}

model DescribeDomainHitRateDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-12-30T08:10:00Z'),
  hitRateInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The byte hit ratio of HTTPS requests.', example='50.0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2019-12-30T08:00:00Z'),
      value?: string(name='Value', description='The byte hit ratio.', example='100.0'),
    }
  ](name='DataModule')
  }(name='HitRateInterval', description='The byte hit ratio at each time interval. The byte hit ratio is measured in percentage.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-30T08:00:00Z'),
}

model DescribeDomainHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries byte hit ratios that are measured in percentage.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainHitRateDataResponse
 */
async function describeDomainHitRateDataWithOptions(request: DescribeDomainHitRateDataRequest, runtime: $RuntimeOptions): DescribeDomainHitRateDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainHitRateData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries byte hit ratios that are measured in percentage.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainHitRateDataRequest
 * @return DescribeDomainHitRateDataResponse
 */
async function describeDomainHitRateData(request: DescribeDomainHitRateDataRequest): DescribeDomainHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainHitRateDataWithOptions(request, runtime);
}

model DescribeDomainHttpCodeDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries the number and proportions of HTTP status codes for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2021-06-29T05:45:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the region. You can call the DescribeCdnRegionAndIsp operation to query regions. If you do not specify this parameter, data in all regions is queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the Internet service provider (ISP). You can call the DescribeCdnRegionAndIsp operation to query ISPs. If you do not specify this parameter, data of all ISPs is queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2021-06-29T05:30:00Z'),
}

model DescribeDomainHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2021-06-29T05:45:00Z'),
  httpCodeData?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2021-06-29T05:40:00Z'),
      value?: {
        codeProportionData?: [ 
        {
          code?: string(name='Code', description='The HTTP status code returned.', example='200'),
          count?: string(name='Count', description='The count of each HTTP status code.', example='300'),
          proportion?: string(name='Proportion', description='The proportion of the HTTP status code.', example='66.046511627907'),
        }
      ](name='CodeProportionData')
      }(name='Value', description='The information about the HTTP status codes.'),
    }
  ](name='UsageData')
  }(name='HttpCodeData', description='The proportions of HTTP status codes at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BC858082-736F-4A25-867B-E5B67C85ACF7'),
  startTime?: string(name='StartTime', description='The beginning of the time range during which data was queried.', example='2021-06-29T05:30:00Z'),
}

model DescribeDomainHttpCodeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainHttpCodeDataResponseBody(name='body'),
}

/**
 * @summary Queries the total number and proportions of HTTP status codes returned from an accelerated domain name. The data is collected every 5 minutes.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainHttpCodeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainHttpCodeDataResponse
 */
async function describeDomainHttpCodeDataWithOptions(request: DescribeDomainHttpCodeDataRequest, runtime: $RuntimeOptions): DescribeDomainHttpCodeDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainHttpCodeData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the total number and proportions of HTTP status codes returned from an accelerated domain name. The data is collected every 5 minutes.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainHttpCodeDataRequest
 * @return DescribeDomainHttpCodeDataResponse
 */
async function describeDomainHttpCodeData(request: DescribeDomainHttpCodeDataRequest): DescribeDomainHttpCodeDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainHttpCodeDataWithOptions(request, runtime);
}

model DescribeDomainHttpCodeDataByLayerRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

If you do not specify this parameter, data of all accelerated domain names under your account is queried.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2020-07-06T22:00:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISP names.

If you do not specify an ISP, data of all ISPs is queried.', example='telecom'),
  layer?: string(name='Layer', description='The protocol by which you want to query HTTP status codes. The network layer supports **IPv4** and **IPv6**. The application layer supports **http**, **https**, and **quic**. You can also set the value to **all**.

Default value: **all**', example='all'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.

If you do not specify a region, data in all regions is queried.', example='hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-07-05T22:00:00Z'),
}

model DescribeDomainHttpCodeDataByLayerResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  httpCodeDataInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2015-12-10T20:35:00Z'),
      totalValue?: string(name='TotalValue', description='The total number of times that HTTP status codes were returned.', example='110'),
      value?: string(name='Value', description='The number of times that the HTTP status code was returned.', example='{ "200": 10, "206": 100}'),
    }
  ](name='DataModule')
  }(name='HttpCodeDataInterval', description='The statistics of HTTP status codes returned at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BEA5625F-8FCF-48F4-851B-CA63946DA664'),
}

model DescribeDomainHttpCodeDataByLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainHttpCodeDataByLayerResponseBody(name='body'),
}

/**
 * @summary Queries HTTP status codes by protocol.
 *
 * @description * You can call this operation up to 20 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * ### Time granularity
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainHttpCodeDataByLayerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainHttpCodeDataByLayerResponse
 */
async function describeDomainHttpCodeDataByLayerWithOptions(request: DescribeDomainHttpCodeDataByLayerRequest, runtime: $RuntimeOptions): DescribeDomainHttpCodeDataByLayerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.layer)) {
    query['Layer'] = request.layer;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainHttpCodeDataByLayer',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries HTTP status codes by protocol.
 *
 * @description * You can call this operation up to 20 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * ### Time granularity
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainHttpCodeDataByLayerRequest
 * @return DescribeDomainHttpCodeDataByLayerResponse
 */
async function describeDomainHttpCodeDataByLayer(request: DescribeDomainHttpCodeDataByLayerRequest): DescribeDomainHttpCodeDataByLayerResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainHttpCodeDataByLayerWithOptions(request, runtime);
}

model DescribeDomainISPDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each call.

By default, this operation queries the proportions of data usage for all accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-29T05:33:00Z'),
}

model DescribeDomainISPDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval. Unit: seconds.', example='86400'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-30T05:40:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='DE81639B-DAC1-4C76-AB72-F34B836837D5'),
  startTime?: string(name='StartTime', description='The beginning of the time range that was queried.', example='2019-11-29T05:33:00Z'),
  value?: {
    ISPProportionData?: [ 
    {
      avgObjectSize?: string(name='AvgObjectSize', description='The average response size. Unit: bytes.', example='7081884.7'),
      avgResponseRate?: string(name='AvgResponseRate', description='The average response speed. Unit: byte/ms.', example='88.92594866772144'),
      avgResponseTime?: string(name='AvgResponseTime', description='The average response time. Unit: milliseconds.', example='79638.0'),
      bps?: string(name='Bps', description='The bandwidth.', example='1311.4601296296296'),
      bytesProportion?: string(name='BytesProportion', description='The proportion of network traffic.', example='0.012220518530445479'),
      ISP?: string(name='ISP', description='The information about the ISP.', example='Alibaba'),
      ispEname?: string(name='IspEname', description='The name of the ISP.', example='alibaba'),
      proportion?: string(name='Proportion', description='The proportion of the HTTP status code.', example='0.004509176173513099'),
      qps?: string(name='Qps', description='The QPS.', example='2.3148148148148147E-5'),
      reqErrRate?: string(name='ReqErrRate', description='The request error rate.', example='0.0'),
      totalBytes?: string(name='TotalBytes', description='The total volume of traffic.', example='7081884'),
      totalQuery?: string(name='TotalQuery', description='The total number of requests.', example='1'),
    }
  ](name='ISPProportionData')
  }(name='Value', description='The access statistics by ISP.'),
}

model DescribeDomainISPDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainISPDataResponseBody(name='body'),
}

/**
 * @summary Queries the proportions of data usage of different Internet service providers (ISPs). Data is collected every day. You can query data collected in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not set StartTime or EndTime, the request returns the data collected in the last 24 hours. If you set both StartTime and EndTime, the request returns the data collected within the specified time range.
 * >*   This operation queries proportions of data usage of different ISPs for only a specific accelerated domain name, or for all accelerated domain names in your Alibaba Cloud account.
 * >*   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainISPDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainISPDataResponse
 */
async function describeDomainISPDataWithOptions(request: DescribeDomainISPDataRequest, runtime: $RuntimeOptions): DescribeDomainISPDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainISPData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the proportions of data usage of different Internet service providers (ISPs). Data is collected every day. You can query data collected in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not set StartTime or EndTime, the request returns the data collected in the last 24 hours. If you set both StartTime and EndTime, the request returns the data collected within the specified time range.
 * >*   This operation queries proportions of data usage of different ISPs for only a specific accelerated domain name, or for all accelerated domain names in your Alibaba Cloud account.
 * >*   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainISPDataRequest
 * @return DescribeDomainISPDataResponse
 */
async function describeDomainISPData(request: DescribeDomainISPDataRequest): DescribeDomainISPDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainISPDataWithOptions(request, runtime);
}

model DescribeDomainMax95BpsDataRequest {
  cycle?: string(name='Cycle', description='The cycle to query the 95th percentile bandwidth data. Default value: **day**. Valid values:

*   **day**: queries the 95th percentile bandwidth data by day.
*   **month**: queries the 95th percentile bandwidth data by month.', example='month'),
  domainName?: string(name='DomainName', description='The accelerated domain name. If you do not specify a domain name, data of all domain names is queried.

> You cannot specify multiple domain names in a DescribeDomainMax95BpsData request.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2017-12-22T08:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-12-21T08:00:00Z'),
  timePoint?: string(name='TimePoint', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-12-21T10:00:00Z'),
}

model DescribeDomainMax95BpsDataResponseBody = {
  detailData?: {
    max95Detail?: [ 
    {
      area?: string(name='Area', description='Region of the 95th percentile bandwidth.', example='CN'),
      max95Bps?: float(name='Max95Bps', description='The 95th percentile bandwidth.', example='16777590.28'),
      max95BpsPeakTime?: string(name='Max95BpsPeakTime', description='Time of the 95th percentile bandwidth.', example='2015-12-11T21:05:00Z'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-12-11T21:00:00Z'),
    }
  ](name='Max95Detail')
  }(name='DetailData', description='Details of the 95th percentile bandwidth.'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  domesticMax95Bps?: string(name='DomesticMax95Bps', description='The 95th percentile bandwidth in the Chinese mainland.', example='16777590.28'),
  endTime?: string(name='EndTime', description='The end of the time range for which the data was queried.', example='2015-12-11T21:00:00Z'),
  max95Bps?: string(name='Max95Bps', description='The 95th percentile bandwidth.', example='16777590.28'),
  overseasMax95Bps?: string(name='OverseasMax95Bps', description='The 95th percentile bandwidth outside the Chinese mainland.', example='0'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
  startTime?: string(name='StartTime', description='The beginning of the time range for which the data was queried.', example='2015-12-10T20:00:00Z'),
}

model DescribeDomainMax95BpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainMax95BpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the 95th percentile bandwidth data of a domain name.
 *
 * @description **You can use one of the following methods to query data:**
 * *   If you specify the StartTime and EndTime parameters and the time range that is specified by these parameters is less than or equal to 24 hours, the 95th percentile bandwidth data on the day of the start time is returned. If the time range that is specified by these parameters is more than 24 hours, the 95th percentile bandwidth data in the month of the start time is returned.
 * *   If you specify the TimePoint and Cycle parameters, the 95th percentile bandwidth data of the cycle is returned.
 * *   If you specify the StartTime, EndTime, and Cycle parameters, the 95th percentile bandwidth data of the cycle is returned.
 * If you do not use one of the methods, the 95th percentile bandwidth data of the previous 24 hours is returned by default.
 * * Maximum time range to query: 90 days 
 * * Minimum data granularity to query: 1 day 
 * * Historical data available: 90 days
 * - You can call this operation up to 100 times per second per account.
 * - The unit of the bandwidth data returned is bit/s.
 *
 * @param request DescribeDomainMax95BpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainMax95BpsDataResponse
 */
async function describeDomainMax95BpsDataWithOptions(request: DescribeDomainMax95BpsDataRequest, runtime: $RuntimeOptions): DescribeDomainMax95BpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cycle)) {
    query['Cycle'] = request.cycle;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.timePoint)) {
    query['TimePoint'] = request.timePoint;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainMax95BpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the 95th percentile bandwidth data of a domain name.
 *
 * @description **You can use one of the following methods to query data:**
 * *   If you specify the StartTime and EndTime parameters and the time range that is specified by these parameters is less than or equal to 24 hours, the 95th percentile bandwidth data on the day of the start time is returned. If the time range that is specified by these parameters is more than 24 hours, the 95th percentile bandwidth data in the month of the start time is returned.
 * *   If you specify the TimePoint and Cycle parameters, the 95th percentile bandwidth data of the cycle is returned.
 * *   If you specify the StartTime, EndTime, and Cycle parameters, the 95th percentile bandwidth data of the cycle is returned.
 * If you do not use one of the methods, the 95th percentile bandwidth data of the previous 24 hours is returned by default.
 * * Maximum time range to query: 90 days 
 * * Minimum data granularity to query: 1 day 
 * * Historical data available: 90 days
 * - You can call this operation up to 100 times per second per account.
 * - The unit of the bandwidth data returned is bit/s.
 *
 * @param request DescribeDomainMax95BpsDataRequest
 * @return DescribeDomainMax95BpsDataResponse
 */
async function describeDomainMax95BpsData(request: DescribeDomainMax95BpsDataRequest): DescribeDomainMax95BpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainMax95BpsDataWithOptions(request, runtime);
}

model DescribeDomainMultiUsageDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

> *   You can specify a maximum of 30 domain names at a time.
>*   If this parameter is not set, data of all your accelerated domain names is queried.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2017-12-10T21:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-12-10T20:00:00Z'),
}

model DescribeDomainMultiUsageDataResponseBody = {
  endTime?: string(name='EndTime', description='The end of the time range that was queried.', example='2017-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C6CCEC4-6B88-4D4A-93E4-D47B3D92CF8F'),
  requestPerInterval?: {
    requestDataModule?: [ 
    {
      domain?: string(name='Domain', description='The accelerated domain name.', example='example.com'),
      request?: long(name='Request', description='The number of requests.', example='11288111'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned number of requests.', example='2017-12-10T20:00:00Z'),
      type?: string(name='Type', description='The type.

>  The value is Simple for Alibaba Cloud CDN.', example='Simple'),
    }
  ](name='RequestDataModule')
  }(name='RequestPerInterval', description='The information about requests collected every 5 minutes.'),
  startTime?: string(name='StartTime', description='The start of the time range that was queried.', example='2017-12-10T20:00:00Z'),
  trafficPerInterval?: {
    trafficDataModule?: [ 
    {
      area?: string(name='Area', description='The name of the region.', example='CN'),
      bps?: float(name='Bps', description='The bandwidth. Unit: bit/s.', example='11288111.1'),
      domain?: string(name='Domain', description='The domain name.', example='example.com'),
      timeStamp?: string(name='TimeStamp', description='The startstamp of the returned usage data.', example='2017-12-10T20:00:00Z'),
      type?: string(name='Type', description='The type of requests. Valid values:

*   **StaticHttps**: static HTTPS requests
*   **DynamicHttps**: dynamic HTTPS requests
*   **DynamicHttp**: dynamic HTTP requests
*   **StaticQuic**: static QUIC requests
*   **DynamicQuic**: dynamic QUIC requests', example='DynamicHttp'),
    }
  ](name='TrafficDataModule')
  }(name='TrafficPerInterval', description='The statistics of network traffic collected every 5 minutes.'),
}

model DescribeDomainMultiUsageDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainMultiUsageDataResponseBody(name='body'),
}

/**
 * @summary Queries the traffic data and the number of requests for multiple accelerated domain names at a time.
 *
 * @description *   If you do not set StartTime or EndTime, data collected within the last 10 minutes is queried.
 * *   The maximum interval between StartTime and EndTime is 1 hour.
 * *   You can query data within the last 90 days.
 * *   You can query the traffic data and the number of requests for accelerated domain names that are deleted.
 * *   You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeDomainMultiUsageDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainMultiUsageDataResponse
 */
async function describeDomainMultiUsageDataWithOptions(request: DescribeDomainMultiUsageDataRequest, runtime: $RuntimeOptions): DescribeDomainMultiUsageDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainMultiUsageData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the traffic data and the number of requests for multiple accelerated domain names at a time.
 *
 * @description *   If you do not set StartTime or EndTime, data collected within the last 10 minutes is queried.
 * *   The maximum interval between StartTime and EndTime is 1 hour.
 * *   You can query data within the last 90 days.
 * *   You can query the traffic data and the number of requests for accelerated domain names that are deleted.
 * *   You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeDomainMultiUsageDataRequest
 * @return DescribeDomainMultiUsageDataResponse
 */
async function describeDomainMultiUsageData(request: DescribeDomainMultiUsageDataRequest): DescribeDomainMultiUsageDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainMultiUsageDataWithOptions(request, runtime);
}

model DescribeDomainPathDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

> You can specify only one domain name in each call.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The interval between the start time and end time must be less than 30 days. Example: 2016-10-21T04:00:00Z.', example='2016-10-21T04:00:00Z'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Pages start from page **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: integers from **1** to **1000**.', example='20'),
  path?: string(name='Path', description='The paths that you want to query. Separate paths with forward slashes (/). If you do not set this parameter, all paths are queried. If you set the value to a directory, it must end with a forward slash (/).

> Fuzzy match is not supported. If you want data to be collected based on a directory, you can specify a specific directory, for example, directory/path/. In this case, bandwidth data is collected based on directory/path/.', example='/path/'),
  startTime?: string(name='StartTime', description='Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Example: 2016-10-20T04:00:00Z.', example='2016-10-20T04:00:00Z'),
}

model DescribeDomainPathDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2017-09-30T17:00:00Z'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='20'),
  pathDataPerInterval?: {
    usageData?: [ 
    {
      acc?: int32(name='Acc', description='The number of visits to the URL.', example='10'),
      path?: string(name='Path', description='The path.', example='/path/'),
      time?: string(name='Time', description='The point in time.', example='2017-09-30T16:00:00Z'),
      traffic?: int32(name='Traffic', description='The amount of network traffic. Unit: bytes.', example='346'),
    }
  ](name='UsageData')
  }(name='PathDataPerInterval', description='A list of bandwidth values collected at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='809A6F10-8238-4A49-BE00-4B2D6305686E'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2017-09-30T16:00:00Z'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model DescribeDomainPathDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainPathDataResponseBody(name='body'),
}

/**
 * @summary Queries monitoring data including the amount of network traffic and the number of visits by directory.
 *
 * @description *   This operation is available only to users that are on the whitelist. If the daily peak bandwidth value of your workloads reaches 10 Gbit/s, you can [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex) to apply to be included in the whitelist.
 * *   You can call this API operation up to 6,000 times per second per account.
 * *   Data collection by directory is available only to specified domain names within your Alibaba Cloud account. It cannot be enabled for all domain names within your Alibaba Cloud account.
 * *   The average size of the files that belong to the domain name must be larger than 1 MB.
 * *   The number of directories specified for a single domain name cannot exceed 100. If the number of directories exceeds 100, the data accuracy reduces.
 * *   If you do not set StartTime or EndTime, data collected within the last 24 hours is queried. If you set both StartTime and EndTime, data within the specified time range is queried.
 * *   You can query data collected within the last 30 days.
 *
 * @param request DescribeDomainPathDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainPathDataResponse
 */
async function describeDomainPathDataWithOptions(request: DescribeDomainPathDataRequest, runtime: $RuntimeOptions): DescribeDomainPathDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainPathData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries monitoring data including the amount of network traffic and the number of visits by directory.
 *
 * @description *   This operation is available only to users that are on the whitelist. If the daily peak bandwidth value of your workloads reaches 10 Gbit/s, you can [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex) to apply to be included in the whitelist.
 * *   You can call this API operation up to 6,000 times per second per account.
 * *   Data collection by directory is available only to specified domain names within your Alibaba Cloud account. It cannot be enabled for all domain names within your Alibaba Cloud account.
 * *   The average size of the files that belong to the domain name must be larger than 1 MB.
 * *   The number of directories specified for a single domain name cannot exceed 100. If the number of directories exceeds 100, the data accuracy reduces.
 * *   If you do not set StartTime or EndTime, data collected within the last 24 hours is queried. If you set both StartTime and EndTime, data within the specified time range is queried.
 * *   You can query data collected within the last 30 days.
 *
 * @param request DescribeDomainPathDataRequest
 * @return DescribeDomainPathDataResponse
 */
async function describeDomainPathData(request: DescribeDomainPathDataRequest): DescribeDomainPathDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainPathDataWithOptions(request, runtime);
}

model DescribeDomainPvDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2015-11-29T00:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2015-11-28T00:00:00Z'),
}

model DescribeDomainPvDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='3600'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-11-28T04:00:00Z'),
  pvDataInterval?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-11-28T03:00:00Z'),
      value?: string(name='Value', description='The number of PVs.', example='9292'),
    }
  ](name='UsageData')
  }(name='PvDataInterval', description='The number of PVs at each interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BCD7D917-76F1-442F-BB75-C810DE34C761'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2015-11-28T03:00:00Z'),
}

model DescribeDomainPvDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainPvDataResponseBody(name='body'),
}

/**
 * @summary Queries the page view (PV) data of an accelerated domain name. The data is collected at an interval of 1 hour. You can query data in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature to for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeDomainPvDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainPvDataResponse
 */
async function describeDomainPvDataWithOptions(request: DescribeDomainPvDataRequest, runtime: $RuntimeOptions): DescribeDomainPvDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainPvData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the page view (PV) data of an accelerated domain name. The data is collected at an interval of 1 hour. You can query data in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature to for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeDomainPvDataRequest
 * @return DescribeDomainPvDataResponse
 */
async function describeDomainPvData(request: DescribeDomainPvDataRequest): DescribeDomainPvDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainPvDataWithOptions(request, runtime);
}

model DescribeDomainQpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries QPS data for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP) for your Alibaba Cloud CDN service. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs. If you do not specify an ISP, data of all ISPs is queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions. If you do not specify a region, data in all regions is queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainQpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-30T05:40:00Z'),
  qpsDataInterval?: {
    dataModule?: [ 
    {
      accDomesticValue?: string(name='AccDomesticValue', description='The number of requests in the Chinese mainland.', example='0'),
      accOverseasValue?: string(name='AccOverseasValue', description='The number of requests outside the Chinese mainland.', example='0'),
      accValue?: string(name='AccValue', description='The total number of requests.', example='0'),
      domesticValue?: string(name='DomesticValue', description='The number of queries per second in the Chinese mainland.', example='0'),
      httpsAccDomesticValue?: string(name='HttpsAccDomesticValue', description='The number of HTTPS requests sent to POPs in the Chinese mainland.', example='1'),
      httpsAccOverseasValue?: string(name='HttpsAccOverseasValue', description='The number of HTTPS requests sent to POPs outside the Chinese mainland.', example='1'),
      httpsAccValue?: string(name='HttpsAccValue', description='The number of HTTPS requests sent to POPs.', example='1'),
      httpsDomesticValue?: string(name='HttpsDomesticValue', description='The number of queries per second that is calculated based on the HTTPS requests sent to POPs in the Chinese mainland.', example='1'),
      httpsOverseasValue?: string(name='HttpsOverseasValue', description='The number of queries per second that is calculated based on the HTTPS requests sent to POPs outside the Chinese mainland.', example='1'),
      httpsValue?: string(name='HttpsValue', description='The number of queries per second that is calculated based on the HTTPS requests sent to points of presence (POPs).', example='1'),
      overseasValue?: string(name='OverseasValue', description='The number of queries per second outside the Chinese mainland.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2019-11-30T05:40:00Z'),
      value?: string(name='Value', description='The total QPS.', example='0'),
    }
  ](name='DataModule')
  }(name='QpsDataInterval', description='The list of QPS records at each interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B8333EDB-4595-46E0-AFE9-29BAA290D0E0'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainQpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainQpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the number of queries per second (QPS) for an accelerated domain name. The data is collected every 5 minutes. You can query data collected within the last 90 days.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainQpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainQpsDataResponse
 */
async function describeDomainQpsDataWithOptions(request: DescribeDomainQpsDataRequest, runtime: $RuntimeOptions): DescribeDomainQpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainQpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of queries per second (QPS) for an accelerated domain name. The data is collected every 5 minutes. You can query data collected within the last 90 days.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainQpsDataRequest
 * @return DescribeDomainQpsDataResponse
 */
async function describeDomainQpsData(request: DescribeDomainQpsDataRequest): DescribeDomainQpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainQpsDataWithOptions(request, runtime);
}

model DescribeDomainQpsDataByLayerRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify a maximum of 500 domain names in a request. Separate multiple domain names with commas (,).

By default, this operation queries the QPS of all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format in the ISO 8601 standard. The time is displayed in UTC.

> The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  interval?: string(name='Interval', description='The time interval between the data entries to return. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Description**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP) for your Alibaba Cloud CDN service. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs. If you do not set this parameter, all ISPs are queried.', example='unicom'),
  layer?: string(name='Layer', description='The layers at which you want to query the number of queries per second. Valid values:

*   **Network layer**: **IPv4**and **IPv6**.
*   **Application layer**: **http**, **https**, and **quic**.
*   **all**: The default value. Both the network and application layers are included.', example='all'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query the most recent region list. If you do not set this parameter, all regions are queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format in the ISO 8601 standard. The time is displayed in UTC.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainQpsDataByLayerResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-30T05:40:00Z'),
  layer?: string(name='Layer', description='The layer at which the data was collected.', example='all'),
  qpsDataInterval?: {
    dataModule?: [ 
    {
      accDomesticValue?: string(name='AccDomesticValue', description='The number of requests in the Chinese mainland.', example='12'),
      accOverseasValue?: string(name='AccOverseasValue', description='The number of requests outside the Chinese mainland.', example='44'),
      accValue?: string(name='AccValue', description='The total number of requests.', example='56'),
      domesticValue?: string(name='DomesticValue', description='The number of queries per second in the Chinese mainland.', example='0.12'),
      overseasValue?: string(name='OverseasValue', description='The number of queries per second outside the Chinese mainland.', example='0.44'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-12-10T21:00:00Z'),
      value?: string(name='Value', description='The total number of queries per second.', example='0.56'),
    }
  ](name='DataModule')
  }(name='QpsDataInterval', description='The number of queries per second at each interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BEA5625F-8FCF-48F4-851B-CA63946DA664'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainQpsDataByLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainQpsDataByLayerResponseBody(name='body'),
}

/**
 * @summary Queries the number of queries per second (QPS) at a specific layer for one or more accelerated domain names. You can query data collected within the last 90 days.
 *
 * @description * You can call this operation up to 20 times per second per user.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter varies with the maximum time range per query. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainQpsDataByLayerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainQpsDataByLayerResponse
 */
async function describeDomainQpsDataByLayerWithOptions(request: DescribeDomainQpsDataByLayerRequest, runtime: $RuntimeOptions): DescribeDomainQpsDataByLayerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.layer)) {
    query['Layer'] = request.layer;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainQpsDataByLayer',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of queries per second (QPS) at a specific layer for one or more accelerated domain names. You can query data collected within the last 90 days.
 *
 * @description * You can call this operation up to 20 times per second per user.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter varies with the maximum time range per query. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainQpsDataByLayerRequest
 * @return DescribeDomainQpsDataByLayerResponse
 */
async function describeDomainQpsDataByLayer(request: DescribeDomainQpsDataByLayerRequest): DescribeDomainQpsDataByLayerResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainQpsDataByLayerWithOptions(request, runtime);
}

model DescribeDomainRealTimeBpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

> You can specify up to 500 domain names in each request.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP).

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs. If you do not set this parameter, all ISPs are queried.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region.

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions. If you do not set this parameter, all regions are queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainRealTimeBpsDataResponseBody = {
  data?: {
    bpsModel?: [ 
    {
      bps?: float(name='Bps', description='The bandwidth. Unit: bit/s.', example='16710625.733333332'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2019-11-30T05:41:00Z'),
    }
  ](name='BpsModel')
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B49E6DDA-F413-422B-B58E-2FA23F286726'),
}

model DescribeDomainRealTimeBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth data about one or more accelerated domain names.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity** The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeBpsDataResponse
 */
async function describeDomainRealTimeBpsDataWithOptions(request: DescribeDomainRealTimeBpsDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeBpsDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeBpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the bandwidth data about one or more accelerated domain names.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity** The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeBpsDataRequest
 * @return DescribeDomainRealTimeBpsDataResponse
 */
async function describeDomainRealTimeBpsData(request: DescribeDomainRealTimeBpsDataRequest): DescribeDomainRealTimeBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeBpsDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeByteHitRateDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each call. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2020-05-15T09:15:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-05-15T09:13:00Z'),
}

model DescribeDomainRealTimeByteHitRateDataResponseBody = {
  data?: {
    byteHitRateDataModel?: [ 
    {
      byteHitRate?: float(name='ByteHitRate', description='The byte hit ratio. The byte hit ratio is measured in percentage.', example='0.8956940476262277'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2019-11-30T05:40:00Z'),
    }
  ](name='ByteHitRateDataModel')
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='70A26B11-3673-479C-AEA8-E03FC5D3496D'),
}

model DescribeDomainRealTimeByteHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeByteHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the byte hit ratios of accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * * The network traffic destined for different domain names may be redirected to the same origin server. Therefore, the byte hit ratios may be inaccurate. The accuracy of query results is based on the actual configurations.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeByteHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeByteHitRateDataResponse
 */
async function describeDomainRealTimeByteHitRateDataWithOptions(request: DescribeDomainRealTimeByteHitRateDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeByteHitRateDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeByteHitRateData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the byte hit ratios of accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * * The network traffic destined for different domain names may be redirected to the same origin server. Therefore, the byte hit ratios may be inaccurate. The accuracy of query results is based on the actual configurations.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeByteHitRateDataRequest
 * @return DescribeDomainRealTimeByteHitRateDataResponse
 */
async function describeDomainRealTimeByteHitRateData(request: DescribeDomainRealTimeByteHitRateDataRequest): DescribeDomainRealTimeByteHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeByteHitRateDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeDetailDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name that you want to query.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Example: 2019-11-30T05:40:00Z.

> The end time must be later than the start time. The difference between the end time and the start time cannot exceed 10 minutes.

This parameter is required.', example='2019-11-30T05:40:00Z'),
  field?: string(name='Field', description='The type of data that you want to query. You can specify multiple data types and separate them with commas (,). Valid values:

*   **qps**: queries per second (QPS)
*   **bps**: bandwidth
*   **http_code**: HTTP status code

This parameter is required.', example='qps'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs. If you do not specify an ISP, data of all ISPs is queried.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not specify a region, data in all regions is queried. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.', example='Guangdong'),
  merge?: string(name='Merge', description='Specifies whether to return a summary value based on ISPs and regions. Valid values:

*   **true**
*   **false**

Default value: **false**.', example='false'),
  mergeLocIsp?: string(name='MergeLocIsp', description='Specifies whether to return a summary value based on ISPs and regions. Valid values:

*   **true**
*   **false**

Default value: **false**.', example='false'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Example: 2019-11-30T05:33:00Z.

This parameter is required.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainRealTimeDetailDataResponseBody = {
  data?: string(name='Data', description='The monitoring data of each ISP in each region.', example='[
      {
            "time_stp": "2018-06-05T20:00:00Z",
            "domain_name": "example.com",
            "location": "Guangdong",
            "isp": "telecom",
            "qps": 10
      },
      {
            "time_stp": "2018-06-05T20:00:00Z",
            "domain_name": "example.com",
            "location": "Jiangsu",
            "isp": "unicom",
            "qps": 11.1
      }
]'),
  requestId?: string(name='RequestId', description='The request ID.', example='B49E6DDA-F413-422B-B58E-2FA23F286726'),
}

model DescribeDomainRealTimeDetailDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeDetailDataResponseBody(name='body'),
}

/**
 * @summary Queries the real-time monitoring data for a domain name.
 *
 * @description *   You can query data in the last seven days. Data is collected every minute.
 * *   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainRealTimeDetailDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeDetailDataResponse
 */
async function describeDomainRealTimeDetailDataWithOptions(request: DescribeDomainRealTimeDetailDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeDetailDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeDetailData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the real-time monitoring data for a domain name.
 *
 * @description *   You can query data in the last seven days. Data is collected every minute.
 * *   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainRealTimeDetailDataRequest
 * @return DescribeDomainRealTimeDetailDataResponse
 */
async function describeDomainRealTimeDetailData(request: DescribeDomainRealTimeDetailDataRequest): DescribeDomainRealTimeDetailDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeDetailDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeHttpCodeDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify multiple accelerated domain names and separate them with commas (,).

> You can specify up to 100 accelerated domain names in each request.

This parameter is required.', example='example.com,example.org'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISP names.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions. If you do not specify a region, all regions are queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:39:00Z'),
}

model DescribeDomainRealTimeHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.

Depending on the maximum time range per query, the value is 60 (1 minute), 300 (5 minutes), or 3600 (1 hour). For more information, see the "Time granularity" section in Usage notes.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com,example.org'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-29T05:42:00Z'),
  realTimeHttpCodeData?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2019-11-29T05:39:00Z'),
      value?: {
        realTimeCodeProportionData?: [ 
        {
          code?: string(name='Code', description='The HTTP status code returned.', example='500'),
          count?: string(name='Count', description='The total number of entries.', example='100'),
          proportion?: string(name='Proportion', description='The proportion of the HTTP status code.', example='28.4496124031008'),
        }
      ](name='RealTimeCodeProportionData')
      }(name='Value', description='The proportions of the HTTP status codes.'),
    }
  ](name='UsageData')
  }(name='RealTimeHttpCodeData', description='The proportions of HTTP status codes at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BC858082-736F-4A25-867B-E5B67C85ACF7'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-11-29T05:39:00Z'),
}

model DescribeDomainRealTimeHttpCodeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeHttpCodeDataResponseBody(name='body'),
}

/**
 * @summary Queries the total number and proportions of HTTP status codes returned from an accelerated domain name.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeHttpCodeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeHttpCodeDataResponse
 */
async function describeDomainRealTimeHttpCodeDataWithOptions(request: DescribeDomainRealTimeHttpCodeDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeHttpCodeDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeHttpCodeData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the total number and proportions of HTTP status codes returned from an accelerated domain name.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeHttpCodeDataRequest
 * @return DescribeDomainRealTimeHttpCodeDataResponse
 */
async function describeDomainRealTimeHttpCodeData(request: DescribeDomainRealTimeHttpCodeDataRequest): DescribeDomainRealTimeHttpCodeDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeHttpCodeDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeQpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

> You can specify up to 500 domain names in each request.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-02T11:26:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP).

If you do not set this parameter, data of all ISPs is queried. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISP names.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region.

If you do not set this parameter, data in all regions is queried. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-02T11:25:00Z'),
}

model DescribeDomainRealTimeQpsDataResponseBody = {
  data?: {
    qpsModel?: [ 
    {
      qps?: float(name='Qps', description='The number of queries per second.', example='1851.25'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the yyyy-MM-ddTHH:mm:ssZ format in the ISO 8601 standard and is in UTC.', example='2019-12-02T11:25:00Z'),
    }
  ](name='QpsModel')
  }(name='Data', description='The data entries returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='32DC9806-E9F9-4490-BBDC-B3A9E32FCC1D'),
}

model DescribeDomainRealTimeQpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeQpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the number of queries per second for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeQpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeQpsDataResponse
 */
async function describeDomainRealTimeQpsDataWithOptions(request: DescribeDomainRealTimeQpsDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeQpsDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeQpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of queries per second for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeQpsDataRequest
 * @return DescribeDomainRealTimeQpsDataResponse
 */
async function describeDomainRealTimeQpsData(request: DescribeDomainRealTimeQpsDataRequest): DescribeDomainRealTimeQpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeQpsDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeReqHitRateDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each call. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2018-01-02T11:26:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2018-01-02T11:23:00Z'),
}

model DescribeDomainRealTimeReqHitRateDataResponseBody = {
  data?: {
    reqHitRateDataModel?: [ 
    {
      reqHitRate?: float(name='ReqHitRate', description='The request hit ratio.', example='0.8956940476262277'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2018-01-02T11:26:00Z'),
    }
  ](name='ReqHitRateDataModel')
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='70A26B11-3673-479C-AEA8-E03FC5D3496D'),
}

model DescribeDomainRealTimeReqHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeReqHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the request hit ratios for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * * By default, requests in the Go programming language use the POST request method. You must manually change the request method to GET by declaring: request.Method="GET".
 * * The network traffic destined for different domain names may be redirected to the same origin server. Therefore, the request hit ratios may be inaccurate. The accuracy of query results is based on the actual configurations.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeReqHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeReqHitRateDataResponse
 */
async function describeDomainRealTimeReqHitRateDataWithOptions(request: DescribeDomainRealTimeReqHitRateDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeReqHitRateDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeReqHitRateData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the request hit ratios for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * * By default, requests in the Go programming language use the POST request method. You must manually change the request method to GET by declaring: request.Method="GET".
 * * The network traffic destined for different domain names may be redirected to the same origin server. Therefore, the request hit ratios may be inaccurate. The accuracy of query results is based on the actual configurations.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeReqHitRateDataRequest
 * @return DescribeDomainRealTimeReqHitRateDataResponse
 */
async function describeDomainRealTimeReqHitRateData(request: DescribeDomainRealTimeReqHitRateDataRequest): DescribeDomainRealTimeReqHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeReqHitRateDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeSrcBpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each request. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-10T20:01:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainRealTimeSrcBpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 60 (1 minute), 300 (5 minutes), and 3600(1 hour). For more information, see **Usage notes**.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-12-10T20:01:00Z'),
  realTimeSrcBpsDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2019-12-10T20:01:00Z'),
      value?: string(name='Value', description='The bandwidth during back-to-origin routing. Unit: bit/s.', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeSrcBpsDataPerInterval', description='The origin bandwidth data at each interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7CBCD6AD-B016-42E5-AE0B-B3731DE8F755'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainRealTimeSrcBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeSrcBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries origin bandwidth data for accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeSrcBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeSrcBpsDataResponse
 */
async function describeDomainRealTimeSrcBpsDataWithOptions(request: DescribeDomainRealTimeSrcBpsDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeSrcBpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeSrcBpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries origin bandwidth data for accelerated domain names.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeSrcBpsDataRequest
 * @return DescribeDomainRealTimeSrcBpsDataResponse
 */
async function describeDomainRealTimeSrcBpsData(request: DescribeDomainRealTimeSrcBpsDataRequest): DescribeDomainRealTimeSrcBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeSrcBpsDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeSrcHttpCodeDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each call. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs. If you leave this parameter empty, all ISPs are queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions. If you leave this parameter empty, all regions are queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T04:40:00Z'),
}

model DescribeDomainRealTimeSrcHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-30T05:40:00Z'),
  realTimeSrcHttpCodeData?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-11-30T05:40:00Z'),
      value?: {
        realTimeSrcCodeProportionData?: [ 
        {
          code?: string(name='Code', description='The HTTP status code returned.', example='200'),
          count?: string(name='Count', description='The count of each HTTP status code.', example='100'),
          proportion?: string(name='Proportion', description='The proportion of the HTTP status code.', example='0.62015503875969'),
        }
      ](name='RealTimeSrcCodeProportionData')
      }(name='Value', description='The proportions of the HTTP status codes.'),
    }
  ](name='UsageData')
  }(name='RealTimeSrcHttpCodeData', description='The proportions of HTTP status codes at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BC858082-736F-4A25-867B-E5B67C85ACF7'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainRealTimeSrcHttpCodeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeSrcHttpCodeDataResponseBody(name='body'),
}

/**
 * @summary Queries the total number and proportions of HTTP status codes returned during back-to-origin routing.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeSrcHttpCodeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeSrcHttpCodeDataResponse
 */
async function describeDomainRealTimeSrcHttpCodeDataWithOptions(request: DescribeDomainRealTimeSrcHttpCodeDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeSrcHttpCodeDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeSrcHttpCodeData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the total number and proportions of HTTP status codes returned during back-to-origin routing.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you set both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeSrcHttpCodeDataRequest
 * @return DescribeDomainRealTimeSrcHttpCodeDataResponse
 */
async function describeDomainRealTimeSrcHttpCodeData(request: DescribeDomainRealTimeSrcHttpCodeDataRequest): DescribeDomainRealTimeSrcHttpCodeDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeSrcHttpCodeDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeSrcTrafficDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each call. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-10T20:01:00Z'),
  startTime?: string(name='StartTime', description='The start of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainRealTimeSrcTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.

Depending on the maximum time range per query, the value is 60 (1 minute), 300 (5 minutes), or 3600 (1 hour). For more information, see the "Time granularity" section in Usage notes.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range for which the data was queried.', example='2019-12-10T20:01:00Z'),
  realTimeSrcTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2019-12-10T20:01:00Z'),
      value?: string(name='Value', description='The amount of traffic.', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeSrcTrafficDataPerInterval', description='The amount of back-to-origin traffic returned at each interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  startTime?: string(name='StartTime', description='The start of the time range for which the data was queried.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainRealTimeSrcTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeSrcTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring data of back-to-origin traffic for one or more specified accelerated domains. The data is collected every minute.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not specify the StartTime or EndTime parameter, the request returns the data collected in the last hour by default. If you specify both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeSrcTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeSrcTrafficDataResponse
 */
async function describeDomainRealTimeSrcTrafficDataWithOptions(request: DescribeDomainRealTimeSrcTrafficDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeSrcTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeSrcTrafficData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the monitoring data of back-to-origin traffic for one or more specified accelerated domains. The data is collected every minute.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * If you do not specify the StartTime or EndTime parameter, the request returns the data collected in the last hour by default. If you specify both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeSrcTrafficDataRequest
 * @return DescribeDomainRealTimeSrcTrafficDataResponse
 */
async function describeDomainRealTimeSrcTrafficData(request: DescribeDomainRealTimeSrcTrafficDataRequest): DescribeDomainRealTimeSrcTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeSrcTrafficDataWithOptions(request, runtime);
}

model DescribeDomainRealTimeTrafficDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each call. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-10T20:01:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP).

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query the most recent region list. If you do not set this parameter, all regions are queried.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region.

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query the most recent region list. If you do not set this parameter, all regions are queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainRealTimeTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.

Depending on the maximum time range per query, the value is 60 (1 minute), 300 (5 minutes), or 3600 (1 hour). For more information, see the "Time granularity" section in Usage notes.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-12-10T20:01:00Z'),
  realTimeTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2019-12-10T20:01:00Z'),
      value?: string(name='Value', description='The traffic value at each time interval.', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeTrafficDataPerInterval', description='The network traffic returned at each time interval. Unit: bytes.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainRealTimeTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealTimeTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring data of network traffic for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 50 times per second per account.
 * * If you do not specify the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you specify both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealTimeTrafficDataResponse
 */
async function describeDomainRealTimeTrafficDataWithOptions(request: DescribeDomainRealTimeTrafficDataRequest, runtime: $RuntimeOptions): DescribeDomainRealTimeTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealTimeTrafficData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the monitoring data of network traffic for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 50 times per second per account.
 * * If you do not specify the StartTime or EndTime parameter, the request returns the data collected in the last hour. If you specify both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the StartTime and EndTime parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|1 hour|7 days|5 minutes|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 *
 * @param request DescribeDomainRealTimeTrafficDataRequest
 * @return DescribeDomainRealTimeTrafficDataResponse
 */
async function describeDomainRealTimeTrafficData(request: DescribeDomainRealTimeTrafficDataRequest): DescribeDomainRealTimeTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealTimeTrafficDataWithOptions(request, runtime);
}

model DescribeDomainRealtimeLogDeliveryRequest {
  domain?: string(name='Domain', description='The accelerated domain name for which real-time log delivery is enabled. You can specify only one domain name.

This parameter is required.', example='example.com'),
}

model DescribeDomainRealtimeLogDeliveryResponseBody = {
  logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed.', example='cn-shanghai'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F8F3852-912F-42AC-80EB-F1CF4284DE93'),
  status?: string(name='Status', description='The status of real-time log delivery. Valid values:

*   **online**
*   **offline**', example='online'),
}

model DescribeDomainRealtimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRealtimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Queries the real-time log delivery information about an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainRealtimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRealtimeLogDeliveryResponse
 */
async function describeDomainRealtimeLogDeliveryWithOptions(request: DescribeDomainRealtimeLogDeliveryRequest, runtime: $RuntimeOptions): DescribeDomainRealtimeLogDeliveryResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRealtimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the real-time log delivery information about an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainRealtimeLogDeliveryRequest
 * @return DescribeDomainRealtimeLogDeliveryResponse
 */
async function describeDomainRealtimeLogDelivery(request: DescribeDomainRealtimeLogDeliveryRequest): DescribeDomainRealtimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRealtimeLogDeliveryWithOptions(request, runtime);
}

model DescribeDomainRegionDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

By default, this operation queries the geographic distribution of users for all accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2015-12-07T12:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2015-12-05T12:00:00Z'),
}

model DescribeDomainRegionDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='86400'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range for which the data was queried.', example='2015-12-07T12:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2E5AD83F-BD7B-462E-8319-2E30E305519A'),
  startTime?: string(name='StartTime', description='The beginning of the time range for which the data was queried.', example='2015-12-05T12:00:00Z'),
  value?: {
    regionProportionData?: [ 
    {
      avgObjectSize?: string(name='AvgObjectSize', description='The average response size. Unit: bytes.', example='800019.0'),
      avgResponseRate?: string(name='AvgResponseRate', description='The average response speed. Unit: bit/s.', example='154.3345765545624'),
      avgResponseTime?: string(name='AvgResponseTime', description='The average response time. Unit: milliseconds.', example='5183.666666666667'),
      bps?: string(name='Bps', description='The bandwidth.', example='380.9614285714286'),
      bytesProportion?: string(name='BytesProportion', description='The proportion of traffic from the region. For example, a value of 90 indicates that 90% of the traffic is from the region.', example='0.003544181046236794'),
      proportion?: string(name='Proportion', description='The proportion of visits from the region. For example, a value of 90 indicates that 90% of the visits are from the region.', example='0.01155980271270037'),
      qps?: string(name='Qps', description='The number of queries per second.', example='5.9523809523809524E-5'),
      region?: string(name='Region', description='The information about the region.', example='Japan'),
      regionEname?: string(name='RegionEname', description='The name of the region.', example='japan'),
      reqErrRate?: string(name='ReqErrRate', description='The request error rate. A value of 90 indicates that 90% of the requests encountered errors.', example='0.0'),
      totalBytes?: string(name='TotalBytes', description='The total traffic. Unit: bytes.', example='2400057'),
      totalQuery?: string(name='TotalQuery', description='The total number of requests.', example='3'),
    }
  ](name='RegionProportionData')
  }(name='Value', description='The proportions of requests initiated from each region.'),
}

model DescribeDomainRegionDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainRegionDataResponseBody(name='body'),
}

/**
 * @summary Queries the geographic distribution of users for a domain name. The data is collected at an interval of one day. You can query the data in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you not use this operation because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not specify the **StartTime** or **EndTime** parameter, data collected within the last **24** hours is queried. If you specify both the **StartTime** and **EndTime** parameters, data collected within the specified time range is queried.
 * >*   There is delay in data collection. If you want to query data collected within the last day, we recommend that you query the data on the next day.
 * >*   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainRegionDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainRegionDataResponse
 */
async function describeDomainRegionDataWithOptions(request: DescribeDomainRegionDataRequest, runtime: $RuntimeOptions): DescribeDomainRegionDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainRegionData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the geographic distribution of users for a domain name. The data is collected at an interval of one day. You can query the data in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you not use this operation because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not specify the **StartTime** or **EndTime** parameter, data collected within the last **24** hours is queried. If you specify both the **StartTime** and **EndTime** parameters, data collected within the specified time range is queried.
 * >*   There is delay in data collection. If you want to query data collected within the last day, we recommend that you query the data on the next day.
 * >*   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainRegionDataRequest
 * @return DescribeDomainRegionDataResponse
 */
async function describeDomainRegionData(request: DescribeDomainRegionDataRequest): DescribeDomainRegionDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainRegionDataWithOptions(request, runtime);
}

model DescribeDomainReqHitRateDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries the request hit ratio for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2017-12-22T08:00:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-12-21T08:00:00Z'),
}

model DescribeDomainReqHitRateDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2017-12-22T08:00:00Z'),
  reqHitRateInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The hit ratio of HTTPS requests.', example='50.0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2017-12-22T08:00:00:00Z'),
      value?: string(name='Value', description='The request hit ratio.', example='100.0'),
    }
  ](name='DataModule')
  }(name='ReqHitRateInterval', description='The request hit ratio data at each time interval. The hit ratio is measured in percentage.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2017-12-21T08:00:00Z'),
}

model DescribeDomainReqHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainReqHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the request hit ratio in percentage.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainReqHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainReqHitRateDataResponse
 */
async function describeDomainReqHitRateDataWithOptions(request: DescribeDomainReqHitRateDataRequest, runtime: $RuntimeOptions): DescribeDomainReqHitRateDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainReqHitRateData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the request hit ratio in percentage.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainReqHitRateDataRequest
 * @return DescribeDomainReqHitRateDataResponse
 */
async function describeDomainReqHitRateData(request: DescribeDomainReqHitRateDataRequest): DescribeDomainReqHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainReqHitRateDataWithOptions(request, runtime);
}

model DescribeDomainSrcBpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each call. Separate multiple domain names with commas (,).

By default, this operation queries the geographic distribution of users for all accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-10T20:30:00Z'),
  interval?: string(name='Interval', description='The time interval between the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Description**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainSrcBpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-12-10T20:30:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
  srcBpsDataPerInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The bandwidth values of origin HTTPS requests.', example='10'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2019-12-10T20:00:00Z'),
      value?: string(name='Value', description='The traffic value at each time interval.', example='500'),
    }
  ](name='DataModule')
  }(name='SrcBpsDataPerInterval', description='The origin bandwidth data at each time interval. Unit: bit/s.'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-10T20:00:00Z'),
}

model DescribeDomainSrcBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainSrcBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries bandwidth monitoring data of requests that are redirected to origin servers for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not specify the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you specify both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the time range to query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainSrcBpsDataResponse
 */
async function describeDomainSrcBpsDataWithOptions(request: DescribeDomainSrcBpsDataRequest, runtime: $RuntimeOptions): DescribeDomainSrcBpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainSrcBpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries bandwidth monitoring data of requests that are redirected to origin servers for one or more accelerated domain names.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not specify the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you specify both the StartTime and EndTime parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the time range to query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcBpsDataRequest
 * @return DescribeDomainSrcBpsDataResponse
 */
async function describeDomainSrcBpsData(request: DescribeDomainSrcBpsDataRequest): DescribeDomainSrcBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainSrcBpsDataWithOptions(request, runtime);
}

model DescribeDomainSrcHttpCodeDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify a maximum of 500 domain names in a request. Separate multiple domain names with commas (,).', example='example.com,example.org'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format in the ISO 8601 standard. The time is displayed in UTC.

> The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  interval?: string(name='Interval', description='The time interval between the data entries to return. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Description**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainSrcHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com,example.org'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-11-30T05:40:00Z'),
  httpCodeData?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-11-30T05:30:00Z'),
      value?: {
        codeProportionData?: [ 
        {
          code?: string(name='Code', description='The HTTP status code returned.', example='200'),
          count?: string(name='Count', description='The total number of entries.', example='2300'),
          proportion?: string(name='Proportion', description='The proportion of the HTTP status code.', example='67.1458998935037'),
        }
      ](name='CodeProportionData')
      }(name='Value', description='The proportions of the HTTP status codes.'),
    }
  ](name='UsageData')
  }(name='HttpCodeData', description='The proportions of HTTP status codes at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BC858082-736F-4A25-867B-E5B67C85ACF7'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2015-11-30T05:33:00Z'),
}

model DescribeDomainSrcHttpCodeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainSrcHttpCodeDataResponseBody(name='body'),
}

/**
 * @summary Queries the proportions of HTTP status codes that are returned during back-to-origin routing.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter varies with the maximum time range per query. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcHttpCodeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainSrcHttpCodeDataResponse
 */
async function describeDomainSrcHttpCodeDataWithOptions(request: DescribeDomainSrcHttpCodeDataRequest, runtime: $RuntimeOptions): DescribeDomainSrcHttpCodeDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainSrcHttpCodeData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the proportions of HTTP status codes that are returned during back-to-origin routing.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter varies with the maximum time range per query. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcHttpCodeDataRequest
 * @return DescribeDomainSrcHttpCodeDataResponse
 */
async function describeDomainSrcHttpCodeData(request: DescribeDomainSrcHttpCodeDataRequest): DescribeDomainSrcHttpCodeDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainSrcHttpCodeDataWithOptions(request, runtime);
}

model DescribeDomainSrcQpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify multiple domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries QPS data for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  interval?: string(name='Interval', description='The time interval between the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

If you leave this parameter empty, data collected in the last 24 hours is queried.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainSrcQpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-11-30T05:40:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7CBCD6AD-B016-42E5-AE0B-B3731DE8F755'),
  srcQpsDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2015-12-10T21:00:00Z'),
      value?: string(name='Value', description='The QPS value.', example='0'),
    }
  ](name='DataModule')
  }(name='SrcQpsDataPerInterval', description='The back-to-origin bandwidth information at each interval.'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-11-30T05:33:00Z'),
}

model DescribeDomainSrcQpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainSrcQpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the number of queries per second (QPS) that are sent to the origin server. You can query data collected in the last 90 days.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * ### Time granularity
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcQpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainSrcQpsDataResponse
 */
async function describeDomainSrcQpsDataWithOptions(request: DescribeDomainSrcQpsDataRequest, runtime: $RuntimeOptions): DescribeDomainSrcQpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainSrcQpsData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of queries per second (QPS) that are sent to the origin server. You can query data collected in the last 90 days.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * ### Time granularity
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcQpsDataRequest
 * @return DescribeDomainSrcQpsDataResponse
 */
async function describeDomainSrcQpsData(request: DescribeDomainSrcQpsDataRequest): DescribeDomainSrcQpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainSrcQpsDataWithOptions(request, runtime);
}

model DescribeDomainSrcTopUrlVisitRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time. The duration between the end time and the start time cannot exceed seven days.', example='2018-10-03T20:00:00Z'),
  sortBy?: string(name='SortBy', description='The method that is used to sort the returned URLs. Default value: **pv**. Valid values:

*   **traf**: by network traffic
*   **pv**: by the number of visits', example='pv'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> If you leave this parameter empty, data within the previous day is queried.', example='2018-10-03T16:00:00Z'),
}

model DescribeDomainSrcTopUrlVisitResponseBody = {
  allUrlList?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='AllUrlList', description='A list of frequently requested URLs.'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  startTime?: string(name='StartTime', description='The beginning of the time range that was queried.', example='2018-10-03T16:00:00Z'),
  url200List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url200List', description='A list of URLs for which 2xx status codes were returned.'),
  url300List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url300List', description='A list of URLs for which 3xx status codes were returned.'),
  url400List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url400List', description='A list of URLs for which 4xx status codes were returned.'),
  url500List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url500List', description='A list of URLs for which 5xx status codes were returned.'),
}

model DescribeDomainSrcTopUrlVisitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainSrcTopUrlVisitResponseBody(name='body'),
}

/**
 * @summary Queries frequently requested origin URLs of one or more accelerated domain names.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   The data is collected at an interval of 5 minutes.
 * >*   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainSrcTopUrlVisitRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainSrcTopUrlVisitResponse
 */
async function describeDomainSrcTopUrlVisitWithOptions(request: DescribeDomainSrcTopUrlVisitRequest, runtime: $RuntimeOptions): DescribeDomainSrcTopUrlVisitResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainSrcTopUrlVisit',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries frequently requested origin URLs of one or more accelerated domain names.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   The data is collected at an interval of 5 minutes.
 * >*   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainSrcTopUrlVisitRequest
 * @return DescribeDomainSrcTopUrlVisitResponse
 */
async function describeDomainSrcTopUrlVisit(request: DescribeDomainSrcTopUrlVisitRequest): DescribeDomainSrcTopUrlVisitResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainSrcTopUrlVisitWithOptions(request, runtime);
}

model DescribeDomainSrcTrafficDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries the origin traffic for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2015-12-10T21:00:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2015-12-10T20:00:00Z'),
}

model DescribeDomainSrcTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  srcTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The amount of traffic generated by origin HTTPS requests.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-12-10T20:35:00Z'),
      value?: string(name='Value', description='The traffic value at each time interval.', example='0'),
    }
  ](name='DataModule')
  }(name='SrcTrafficDataPerInterval', description='The amount of origin traffic returned at each time interval. Unit: bytes.'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2015-12-10T20:00:00Z'),
}

model DescribeDomainSrcTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainSrcTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries origin traffic for one or more specified accelerated domain names.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainSrcTrafficDataResponse
 */
async function describeDomainSrcTrafficDataWithOptions(request: DescribeDomainSrcTrafficDataRequest, runtime: $RuntimeOptions): DescribeDomainSrcTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainSrcTrafficData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries origin traffic for one or more specified accelerated domain names.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainSrcTrafficDataRequest
 * @return DescribeDomainSrcTrafficDataResponse
 */
async function describeDomainSrcTrafficData(request: DescribeDomainSrcTrafficDataRequest): DescribeDomainSrcTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainSrcTrafficDataWithOptions(request, runtime);
}

model DescribeDomainTopClientIpVisitRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

By default, this operation queries client IP addresses for all accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2019-10-01T16:00:00Z'),
  limit?: string(name='Limit', description='The maximum number of entries to return. Maximum value: 100.

Default value: 20. The default value specifies that the top 20 IP addresses are returned.', example='20'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. Separate multiple region names with commas (,).

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query regions.', example='beijing'),
  sortBy?: string(name='SortBy', description='The criterion by which you want to sort client IP addresses. Valid values:

*   **traf**: by network traffic. This is the default value.
*   **acc**: by the number of requests.', example='traf'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-09-30T16:00:00Z'),
}

model DescribeDomainTopClientIpVisitResponseBody = {
  clientIpList?: [ 
    {
      acc?: long(name='Acc', description='The total number of requests.', example='256'),
      clientIp?: string(name='ClientIp', description='The client IP address returned. Only IPv4 addressed are supported.', example='1.1.xxx'),
      rank?: int32(name='Rank', description='The ranking of the client IP address returned.', example='2'),
      traffic?: long(name='Traffic', description='The total amount of network traffic consumed. Unit: bytes.', example='1024'),
    }
  ](name='ClientIpList', description='A list of client IP addresses.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
}

model DescribeDomainTopClientIpVisitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainTopClientIpVisitResponseBody(name='body'),
}

/**
 * @summary Queries client IP addresses that are ranked by the number of requests or the amount of network traffic within a specific time range for one or more accelerated domain names. You can query data collected within the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature to for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   Data is collected every hour.
 * >*   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainTopClientIpVisitRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainTopClientIpVisitResponse
 */
async function describeDomainTopClientIpVisitWithOptions(request: DescribeDomainTopClientIpVisitRequest, runtime: $RuntimeOptions): DescribeDomainTopClientIpVisitResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainTopClientIpVisit',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries client IP addresses that are ranked by the number of requests or the amount of network traffic within a specific time range for one or more accelerated domain names. You can query data collected within the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature to for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   Data is collected every hour.
 * >*   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainTopClientIpVisitRequest
 * @return DescribeDomainTopClientIpVisitResponse
 */
async function describeDomainTopClientIpVisit(request: DescribeDomainTopClientIpVisitRequest): DescribeDomainTopClientIpVisitResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainTopClientIpVisitWithOptions(request, runtime);
}

model DescribeDomainTopReferVisitRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple accelerated domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2019-12-22T12:00:00Z'),
  sortBy?: string(name='SortBy', description='The order in which you want to sort the queried information. Valid values:

*   **traf**: by network traffic.
*   **pv**: by the number of page views. This is the default value.', example='pv'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-21T12:00:00Z'),
}

model DescribeDomainTopReferVisitResponseBody = {
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='95994621-8382-464B-8762-C708E73568D1'),
  startTime?: string(name='StartTime', description='The beginning of the time range that was queried.', example='2019-12-21T12:00:00Z'),
  topReferList?: {
    referList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='200'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.5'),
      referDetail?: string(name='ReferDetail', description='The URLs to the most frequently requested web pages.', example='learn.aliyundoc.com'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='3'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.5'),
    }
  ](name='ReferList')
  }(name='TopReferList', description='The most frequently requested web pages.'),
}

model DescribeDomainTopReferVisitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainTopReferVisitResponseBody(name='body'),
}

/**
 * @summary Queries frequently requested web pages of one or more accelerated domain names on a specified day and sorts the web pages. You can query data collected within the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature or [ship real-time logs in Log Service](https://help.aliyun.com/document_detail/440145.html) to analyze data.
 * > 
 * *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * *   Data is collected at an interval of five minutes.
 * *   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainTopReferVisitRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainTopReferVisitResponse
 */
async function describeDomainTopReferVisitWithOptions(request: DescribeDomainTopReferVisitRequest, runtime: $RuntimeOptions): DescribeDomainTopReferVisitResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainTopReferVisit',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries frequently requested web pages of one or more accelerated domain names on a specified day and sorts the web pages. You can query data collected within the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature or [ship real-time logs in Log Service](https://help.aliyun.com/document_detail/440145.html) to analyze data.
 * > 
 * *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * *   Data is collected at an interval of five minutes.
 * *   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainTopReferVisitRequest
 * @return DescribeDomainTopReferVisitResponse
 */
async function describeDomainTopReferVisit(request: DescribeDomainTopReferVisitRequest): DescribeDomainTopReferVisitResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainTopReferVisitWithOptions(request, runtime);
}

model DescribeDomainTopUrlVisitRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name that you want to query.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time. The maximum time range that can be specified is seven days.', example='2019-10-04T16:00:00Z'),
  sortBy?: string(name='SortBy', description='The method that is used to sort the returned URLs. Default value: **pv**. Valid values:

*   **traf**: by network traffic
*   **pv**: by the number of page views', example='pv'),
  startTime?: string(name='StartTime', description='The start of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

If you want to query data of a specific day, we recommend that you set the value in the yyyy-MM-ddT16:00:00Z format.', example='2019-10-04T00:00:00Z'),
}

model DescribeDomainTopUrlVisitResponseBody = {
  allUrlList?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='AllUrlList', description='A list of frequently requested URLs.'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-10-03T16:00:00Z'),
  url200List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/aWQ9SE5KU0bGxfcGNfbGl2ZQ,,/HNJSMPP360.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url200List', description='A list of URLs for which 2xx status codes were returned.'),
  url300List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/a0.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url300List', description='A list of URLs for which 3xx status codes were returned.'),
  url400List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/aWQ9SE5KU01QUhbGxfcGNfbGl2ZQ,,/HNJSMPP360.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='1884'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url400List', description='A list of URLs for which 4xx status codes were returned.'),
  url500List?: {
    urlList?: [ 
    {
      flow?: string(name='Flow', description='The amount of network traffic. Unit: bytes.', example='460486880'),
      flowProportion?: float(name='FlowProportion', description='The proportion of network traffic consumed to access the URL.', example='0.35'),
      urlDetail?: string(name='UrlDetail', description='The complete URL.', example='http://example.com/nn_live/nn_x64/aWQ9SE5KU0GNfbGl2ZQ,,/HNJSMPP360.m3u8'),
      visitData?: string(name='VisitData', description='The number of visits to the URL.', example='161673'),
      visitProportion?: float(name='VisitProportion', description='The proportion of visits to the URL.', example='0.35'),
    }
  ](name='UrlList')
  }(name='Url500List', description='A list of URLs for which 5xx status codes were returned.'),
}

model DescribeDomainTopUrlVisitResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainTopUrlVisitResponseBody(name='body'),
}

/**
 * @summary Queries top 100 frequently requested URLs of an accelerated domain name within a specified time range.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can query data collected in the last 90 days.
 * >*   You can specify only one domain name in each call.
 * >*   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainTopUrlVisitRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainTopUrlVisitResponse
 */
async function describeDomainTopUrlVisitWithOptions(request: DescribeDomainTopUrlVisitRequest, runtime: $RuntimeOptions): DescribeDomainTopUrlVisitResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainTopUrlVisit',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries top 100 frequently requested URLs of an accelerated domain name within a specified time range.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can query data collected in the last 90 days.
 * >*   You can specify only one domain name in each call.
 * >*   You can call this operation up to 10 times per second per account.
 *
 * @param request DescribeDomainTopUrlVisitRequest
 * @return DescribeDomainTopUrlVisitResponse
 */
async function describeDomainTopUrlVisit(request: DescribeDomainTopUrlVisitRequest): DescribeDomainTopUrlVisitResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainTopUrlVisitWithOptions(request, runtime);
}

model DescribeDomainTrafficDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,).

By default, this operation queries the network traffic for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2015-12-10T21:00:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds.

The time granularity varies with the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see **Usage notes**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). You can call the [DescribeCdnRegionAndIsp](~~DescribeCdnRegionAndIsp~~) operation to query ISPs.

If you do not specify an ISP, data of all ISPs is queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. You can call the [DescribeCdnRegionAndIsp](~~DescribeCdnRegionAndIsp~~) operation to query regions.

If you do not specify a region, data in all regions is queried.', example='beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2015-12-10T20:00:00Z'),
}

model DescribeDomainTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-12-10T21:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B955107D-E658-4E77-B913-E0AC3D31693E'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2015-12-10T20:00:00Z'),
  trafficDataPerInterval?: {
    dataModule?: [ 
    {
      domesticValue?: string(name='DomesticValue', description='The amount of network traffic in the Chinese mainland.', example='0'),
      httpsDomesticValue?: string(name='HttpsDomesticValue', description='The amount of HTTPS traffic on points of presence (POPs) in the Chinese mainland.', example='0'),
      httpsOverseasValue?: string(name='HttpsOverseasValue', description='The amount of HTTPS traffic on POPs outside the Chinese mainland.', example='0'),
      httpsValue?: string(name='HttpsValue', description='The total amount of HTTPS traffic on POPs.', example='423304182'),
      overseasValue?: string(name='OverseasValue', description='The amount of network traffic outside the Chinese mainland.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2015-12-10T20:00:00Z'),
      value?: string(name='Value', description='The total volume of traffic.', example='423304182'),
    }
  ](name='DataModule')
  }(name='TrafficDataPerInterval', description='The amount of network traffic at each time interval. Unit: bytes.'),
}

model DescribeDomainTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries network traffic for one or more accelerated domain names. You can query data that is collected in the last 90 days.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366|04:00 on the next day|
 *
 * @param request DescribeDomainTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainTrafficDataResponse
 */
async function describeDomainTrafficDataWithOptions(request: DescribeDomainTrafficDataRequest, runtime: $RuntimeOptions): DescribeDomainTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainTrafficData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries network traffic for one or more accelerated domain names. You can query data that is collected in the last 90 days.
 *
 * @description * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|366 days|366|04:00 on the next day|
 *
 * @param request DescribeDomainTrafficDataRequest
 * @return DescribeDomainTrafficDataResponse
 */
async function describeDomainTrafficData(request: DescribeDomainTrafficDataRequest): DescribeDomainTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainTrafficDataWithOptions(request, runtime);
}

model DescribeDomainUsageDataRequest {
  area?: string(name='Area', description='The billable region. Valid values:

*   **CN** (default): inside the Chinese mainland
*   **OverSeas**: outside the Chinese mainland
*   **AP1**: Asia Pacific 1
*   **AP2**: Asia Pacific 2
*   **AP3**: Asia Pacific 3
*   **NA**: North America
*   **SA**: South America
*   **EU**: Europe
*   **MEAA**: Middle East and Africa
*   **all**: all the preceding billable regions', example='CN'),
  dataProtocol?: string(name='DataProtocol', description='The protocol of the data that you want to query. Valid values:

*   **http:** HTTP
*   **https:** HTTPS
*   **quic**: QUIC
*   **all** (default): HTTP, HTTPS, and QUIC', example='all'),
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify up to 100 domain names in each request. Separate multiple domain names with commas (,).

> If you leave this parameter empty, the usage data of all accelerated domain names in your Alibaba Cloud account is returned.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time. The maximum time range that can be specified is 31 days.

This parameter is required.', example='2015-12-10T22:00:00Z'),
  field?: string(name='Field', description='The type of the data that you want to query. Valid values:

*   **bps**: bandwidth
*   **traf**: traffic
*   **acc**: requests

> If you set this parameter to **acc**, the **Area** parameter is not supported.

This parameter is required.', example='bps'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds. Valid values: **300** (5 minutes), **3600** (1 hour), and **86400** (1 day).

*   If **Interval** is set to **300**, you can query usage data in the last 6 months. The maximum time range per query that can be specified is 3 days.
*   If **Interval** is set to **3600** or **86400**, you can query usage data of the previous year.
*   If you leave the **Interval** parameter empty, the maximum time range that you can query is 1 month. If you specify a time range of 1 to 3 days, the time interval between the entries that are returned is 1 hour. If you specify a time range of at least 4 days, the time interval between the entries that are returned is 1 day.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> Data is collected every 5 minutes.

This parameter is required.', example='2015-12-10T20:00:00Z'),
  type?: string(name='Type', description='The type of content that you want to query. Valid values:

*   **static**: static content
*   **dynamic**: dynamic content
*   **all** (default): both static and dynamic content', example='static'),
}

model DescribeDomainUsageDataResponseBody = {
  area?: string(name='Area', description='The ID of the billable region where the data was collected.', example='CN'),
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2015-12-10T22:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B955107D-E658-4E77-B913-E0AC3D31693E'),
  startTime?: string(name='StartTime', description='The beginning of the time range during which data was queried.', example='2015-12-10T20:00:00Z'),
  type?: string(name='Type', description='The type of content.', example='static'),
  usageDataPerInterval?: {
    dataModule?: [ 
    {
      peakTime?: string(name='PeakTime', description='The time of the peak bandwidth value if the **Field** parameter in the request is set to **bps**. Otherwise, this parameter returns the same value as the **TimeStamp** parameter.', example='2015-12-10T21:30:00Z'),
      specialValue?: string(name='SpecialValue', description='The resource usage in a specific scenario.

> SpecialValue indicates the data usage in a specific scenario. If no special billable item is specified, ignore this parameter.', example='423304182'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.

> **TimeStamp** indicates the timestamp of the data returned at each interval.', example='2015-12-10T21:30:00Z'),
      value?: string(name='Value', description='The amount of resource usage.', example='423304182'),
    }
  ](name='DataModule')
  }(name='UsageDataPerInterval', description='The resource usage that was collected at each interval.'),
}

model DescribeDomainUsageDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainUsageDataResponseBody(name='body'),
}

/**
 * @summary Queries the resource usage data of specific domain names in a specified billable region.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|90 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainUsageDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainUsageDataResponse
 */
async function describeDomainUsageDataWithOptions(request: DescribeDomainUsageDataRequest, runtime: $RuntimeOptions): DescribeDomainUsageDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.area)) {
    query['Area'] = request.area;
  }
  if (!$isNull(request.dataProtocol)) {
    query['DataProtocol'] = request.dataProtocol;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.field)) {
    query['Field'] = request.field;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainUsageData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the resource usage data of specific domain names in a specified billable region.
 *
 * @description * You can call this operation up to 10 times per second per account.
 * * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|4 hours|
 * |1 day|90 days|366 days|04:00 on the next day|
 *
 * @param request DescribeDomainUsageDataRequest
 * @return DescribeDomainUsageDataResponse
 */
async function describeDomainUsageData(request: DescribeDomainUsageDataRequest): DescribeDomainUsageDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainUsageDataWithOptions(request, runtime);
}

model DescribeDomainUvDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2019-11-29T04:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-29T00:00:00Z'),
}

model DescribeDomainUvDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval. Unit: seconds.', example='3600'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range that was queried.', example='2019-11-29T04:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E9D3257A-1B7C-414C-90C1-8D07AC47BCAC'),
  startTime?: string(name='StartTime', description='The beginning of the time range that was queried.', example='2019-11-29T00:00:00Z'),
  uvDataInterval?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2019-11-29T00:00:00Z'),
      value?: string(name='Value', description='The number of UVs.', example='318'),
    }
  ](name='UsageData')
  }(name='UvDataInterval', description='The number of UVs at each interval.'),
}

model DescribeDomainUvDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainUvDataResponseBody(name='body'),
}

/**
 * @summary Queries the unique visitor (UV) data of an accelerated domain name. Data is collected every hour. You can query data collected in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > 
 * *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * *   You can specify only one accelerated domain name or all accelerated domain names in your Alibaba Cloud account.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainUvDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainUvDataResponse
 */
async function describeDomainUvDataWithOptions(request: DescribeDomainUvDataRequest, runtime: $RuntimeOptions): DescribeDomainUvDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainUvData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the unique visitor (UV) data of an accelerated domain name. Data is collected every hour. You can query data collected in the last 90 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > 
 * *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * *   You can specify only one accelerated domain name or all accelerated domain names in your Alibaba Cloud account.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeDomainUvDataRequest
 * @return DescribeDomainUvDataResponse
 */
async function describeDomainUvData(request: DescribeDomainUvDataRequest): DescribeDomainUvDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainUvDataWithOptions(request, runtime);
}

model DescribeDomainVerifyDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='www.yourdomain.com'),
  globalResourcePlan?: string(name='GlobalResourcePlan', description='Specifies whether to enable the global resource plan.

Valid values:

*   off

    <!-- -->

    <!-- -->

    <!-- -->

*   on

    <!-- -->

    <!-- -->

    <!-- -->', example='off'),
}

model DescribeDomainVerifyDataResponseBody = {
  content?: string(name='Content', description='The verification content.', example='{
    "verifiCode": "uy0-DbxL4HBmUtSUXpkXctaSnCAUKhhNH6WKl-JnJY4",
    "verifyKey": "_acme-challenge"
  }'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F61CDR30-E83C-4FDA-BF73-9A94CDD44229'),
}

model DescribeDomainVerifyDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainVerifyDataResponseBody(name='body'),
}

/**
 * @summary Queries the verification content of a domain name, including the host record and record value.
 *
 * @description You can call this operation to query the verification content of an accelerated domain name based on whether the global resource plan is enabled.
 *
 * @param request DescribeDomainVerifyDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainVerifyDataResponse
 */
async function describeDomainVerifyDataWithOptions(request: DescribeDomainVerifyDataRequest, runtime: $RuntimeOptions): DescribeDomainVerifyDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.globalResourcePlan)) {
    query['GlobalResourcePlan'] = request.globalResourcePlan;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainVerifyData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the verification content of a domain name, including the host record and record value.
 *
 * @description You can call this operation to query the verification content of an accelerated domain name based on whether the global resource plan is enabled.
 *
 * @param request DescribeDomainVerifyDataRequest
 * @return DescribeDomainVerifyDataResponse
 */
async function describeDomainVerifyData(request: DescribeDomainVerifyDataRequest): DescribeDomainVerifyDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainVerifyDataWithOptions(request, runtime);
}

model DescribeDomainsBySourceRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The origin servers. Separate multiple origin servers with commas (,). Fuzzy match is not supported.

This parameter is required.', example='example.com'),
}

model DescribeDomainsBySourceResponseBody = {
  domainsList?: {
    domainsData?: [ 
    {
      domainInfos?: {
        domainInfo?: [ 
        {
          cdnType?: string(name='CdnType', description='The workload type of the accelerated domain name. Valid values:

*   **web**: images and small files
*   **download**: large files
*   **video**: on-demand video and audio streaming', example='web'),
          createTime?: string(name='CreateTime', description='The creation time.', example='2016-07-12T11:53:19+08:00'),
          domainCname?: string(name='DomainCname', description='The CNAME record assigned to the domain name.', example='***.alikunlun.com'),
          domainName?: string(name='DomainName', description='The domain name.', example='example.org'),
          status?: string(name='Status', description='The status of the domain name. Valid values:

*   **applying**: The domain name is under review.
*   **configuring**: The domain name is being configured.
*   **online**: The domain name is working as expected.
*   **stopping**: The domain name is being stopped.
*   **offline**: The domain name is disabled.
*   **disabling**: The domain name is being removed.', example='online'),
          updateTime?: string(name='UpdateTime', description='The update time.', example='2017-03-31T04:49:00+08:00'),
        }
      ](name='domainInfo')
      }(name='DomainInfos', description='Information about the domain name.'),
      domains?: {
        domainNames?: [ string ](name='domainNames')
      }(name='Domains', description='The domain names that correspond to each origin server.'),
      source?: string(name='Source', description='The origin server.', example='example.com'),
    }
  ](name='DomainsData')
  }(name='DomainsList', description='The domain names corresponding to each origin server.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B0F074E5-A1AC-4B32-8EA2-6F450410D1E0'),
  sources?: string(name='Sources', description='The origin servers.', example='example.com,aliyundoc.com'),
}

model DescribeDomainsBySourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainsBySourceResponseBody(name='body'),
}

/**
 * @summary Queries accelerated domain names by origin server.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeDomainsBySourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainsBySourceResponse
 */
async function describeDomainsBySourceWithOptions(request: DescribeDomainsBySourceRequest, runtime: $RuntimeOptions): DescribeDomainsBySourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainsBySource',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries accelerated domain names by origin server.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeDomainsBySourceRequest
 * @return DescribeDomainsBySourceResponse
 */
async function describeDomainsBySource(request: DescribeDomainsBySourceRequest): DescribeDomainsBySourceResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainsBySourceWithOptions(request, runtime);
}

model DescribeDomainsUsageByDayRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

If you do not specify an accelerated domain name, the data of all accelerated domain names that belong to your account is queried.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-23T09:00:00Z'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-22T08:00:00Z'),
}

model DescribeDomainsUsageByDayResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='86400'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-12-23T09:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C88EF8ED-72F0-45EA-9E86-95114E224FC5'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-22T08:00:00Z'),
  usageByDays?: {
    usageByDay?: [ 
    {
      bytesHitRate?: string(name='BytesHitRate', description='The byte hit ratio. The byte hit ratio is measured in percentage.', example='97.46250599529726'),
      maxBps?: string(name='MaxBps', description='The peak bandwidth value. Unit: bit/s.', example='306747.76'),
      maxBpsTime?: string(name='MaxBpsTime', description='The time when the bandwidth reached the peak value.', example='2019-12-23 10:55:00'),
      maxSrcBps?: string(name='MaxSrcBps', description='The peak bandwidth value during back-to-origin routing. Unit: bit/s.', example='72584.072'),
      maxSrcBpsTime?: string(name='MaxSrcBpsTime', description='The time when the bandwidth during back-to-origin routing reached the peak value.', example='2019-12-23 11:45:00'),
      qps?: string(name='Qps', description='The number of queries per second (QPS).', example='7.466354166666667'),
      requestHitRate?: string(name='RequestHitRate', description='The cache hit ratio that is calculated based on requests. The cache hit ratio is measured in percentage.', example='70.24770071912111'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2019-12-22'),
      totalAccess?: string(name='TotalAccess', description='The total amount of requests.', example='645093'),
      totalTraffic?: string(name='TotalTraffic', description='The total amount of network traffic. Unit: bytes.', example='564300099309'),
    }
  ](name='UsageByDay')
  }(name='UsageByDays', description='The monitoring data collected at each time interval.'),
  usageTotal?: {
    bytesHitRate?: string(name='BytesHitRate', description='The byte hit ratio. The byte hit ratio is measured in percentage.', example='97.03110726801242'),
    maxBps?: string(name='MaxBps', description='The peak bandwidth value. Unit: bit/s.', example='1.0747912780000001E8'),
    maxBpsTime?: string(name='MaxBpsTime', description='The time when the bandwidth reached the peak value.', example='2019-12-23 10:55:00'),
    maxSrcBps?: string(name='MaxSrcBps', description='The peak bandwidth value during back-to-origin routing. Unit: bit/s.', example='72584.072'),
    maxSrcBpsTime?: string(name='MaxSrcBpsTime', description='The time when the bandwidth during back-to-origin routing reached the peak value.', example='2019-12-23 11:45:00'),
    requestHitRate?: string(name='RequestHitRate', description='The cache hit ratio that is calculated based on requests. The cache hit ratio is measured in percentage.', example='69.92610837438424'),
    totalAccess?: string(name='TotalAccess', description='The total amount of requests.', example='1319500'),
    totalTraffic?: string(name='TotalTraffic', description='The total amount of network traffic. Unit: bytes.', example='1117711832100'),
  }(name='UsageTotal', description='The summarized monitoring data.'),
}

model DescribeDomainsUsageByDayResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDomainsUsageByDayResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring data of an accelerated domain name. Data is collected every day. You can query data collected within the last 90 days.
 *
 * @description *   You can call this operation up to 10 times per second per account.
 * *   If you do not set StartTime or EndTime, data within the last 24 hours is queried. If you set both StartTime and EndTime, data within the specified time range is queried.
 * *   You can query the monitoring data of a specific accelerated domain name or all accelerated domain names that belong to your Alibaba Cloud account.
 *
 * @param request DescribeDomainsUsageByDayRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDomainsUsageByDayResponse
 */
async function describeDomainsUsageByDayWithOptions(request: DescribeDomainsUsageByDayRequest, runtime: $RuntimeOptions): DescribeDomainsUsageByDayResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDomainsUsageByDay',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the monitoring data of an accelerated domain name. Data is collected every day. You can query data collected within the last 90 days.
 *
 * @description *   You can call this operation up to 10 times per second per account.
 * *   If you do not set StartTime or EndTime, data within the last 24 hours is queried. If you set both StartTime and EndTime, data within the specified time range is queried.
 * *   You can query the monitoring data of a specific accelerated domain name or all accelerated domain names that belong to your Alibaba Cloud account.
 *
 * @param request DescribeDomainsUsageByDayRequest
 * @return DescribeDomainsUsageByDayResponse
 */
async function describeDomainsUsageByDay(request: DescribeDomainsUsageByDayRequest): DescribeDomainsUsageByDayResponse {
  var runtime = new $RuntimeOptions{};
  return describeDomainsUsageByDayWithOptions(request, runtime);
}

model DescribeEsExceptionDataRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.

This parameter is required.', example='2021-02-18T20:00:00Z'),
  ruleId?: string(name='RuleId', description='The script ID. You can call the [DescribeCdnDomainConfigs](https://help.aliyun.com/document_detail/90924.html) operation to query script IDs.

This parameter is required.', example='212896**'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2021-02-17T20:00:00Z'),
}

model DescribeEsExceptionDataResponseBody = {
  contents?: [ 
    {
      columns?: [ string ](name='Columns', description='Information about the time column and the error column name.'),
      name?: string(name='Name', description='The name of the table that shows the errors of the script.', example='401'),
      points?: [ string ](name='Points', description='The time columns and error column names.'),
    }
  ](name='Contents', description='The content of the script for which an error was reported.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='99D61AB3-6164-4CF2-A0DE-129C9B07618B'),
}

model DescribeEsExceptionDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEsExceptionDataResponseBody(name='body'),
}

/**
 * @summary Queries the execution errors of a script in EdgeScript (ES).
 *
 * @description *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeEsExceptionDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEsExceptionDataResponse
 */
async function describeEsExceptionDataWithOptions(request: DescribeEsExceptionDataRequest, runtime: $RuntimeOptions): DescribeEsExceptionDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEsExceptionData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the execution errors of a script in EdgeScript (ES).
 *
 * @description *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeEsExceptionDataRequest
 * @return DescribeEsExceptionDataResponse
 */
async function describeEsExceptionData(request: DescribeEsExceptionDataRequest): DescribeEsExceptionDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeEsExceptionDataWithOptions(request, runtime);
}

model DescribeEsExecuteDataRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.

This parameter is required.', example='2021-02-18T20:00:00Z'),
  ruleId?: string(name='RuleId', description='The ID of the rule. You can call the [DescribeCdnDomainConfigs](https://help.aliyun.com/document_detail/90924.html) operation to query script IDs.

This parameter is required.', example='212896**'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2021-02-17T20:00:00Z'),
}

model DescribeEsExecuteDataResponseBody = {
  contents?: [ 
    {
      columns?: [ string ](name='Columns', description='The time and column names in the table that shows the status of the script.'),
      name?: string(name='Name', description='The name of the table that shows the status of the script.', example='Exception'),
      points?: [ string ](name='Points', description='The list of timestamps and values in the corresponding columns of the table that shows the status of the script.'),
    }
  ](name='Contents', description='The content of the script.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='99D61AB3-6164-4CF2-A0DE-129C9B07618B'),
}

model DescribeEsExecuteDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEsExecuteDataResponseBody(name='body'),
}

/**
 * @summary Queries the execution status of scripts in EdgeScript (ES).
 *
 * @description *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeEsExecuteDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEsExecuteDataResponse
 */
async function describeEsExecuteDataWithOptions(request: DescribeEsExecuteDataRequest, runtime: $RuntimeOptions): DescribeEsExecuteDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEsExecuteData',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the execution status of scripts in EdgeScript (ES).
 *
 * @description *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeEsExecuteDataRequest
 * @return DescribeEsExecuteDataResponse
 */
async function describeEsExecuteData(request: DescribeEsExecuteDataRequest): DescribeEsExecuteDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeEsExecuteDataWithOptions(request, runtime);
}

model DescribeFCTriggerRequest {
  triggerARN?: string(name='TriggerARN', description='The trigger that corresponds to the Function Compute service.

This parameter is required.', example='acs:cdn:{RegionID}:{AccountID}:{Filter}'),
}

model DescribeFCTriggerResponseBody = {
  FCTrigger?: {
    eventMetaName?: string(name='EventMetaName', description='The name of the event.', example='LogFileCreated'),
    eventMetaVersion?: string(name='EventMetaVersion', description='The version of the event.', example='1.0.0'),
    notes?: string(name='Notes', description='The remarks of the Function Compute trigger.', example='test'),
    roleARN?: string(name='RoleARN', description='The assigned Resource Access Management (RAM) role.', example='acs:ram:: 1234567890:role/aliyuncdneventnotificationrole'),
    sourceArn?: string(name='SourceArn', description='The resources and filters for event listening.', example='acs:cdn:*:1234567890:domain/example.com'),
    triggerARN?: string(name='TriggerARN', description='The trigger that corresponds to the Function Compute service.', example='acs:fc:cn-beijing: 1234567890:services/FCTestService/functions/printEvent/triggers/testtrigger'),
  }(name='FCTrigger', description='The Function Compute trigger that you want to query.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EC046C5D-8CB4-4B6B-B7F8-B335E51EF90E'),
}

model DescribeFCTriggerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFCTriggerResponseBody(name='body'),
}

/**
 * @summary Queries a specified Function Compute trigger.
 *
 * @param request DescribeFCTriggerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeFCTriggerResponse
 */
async function describeFCTriggerWithOptions(request: DescribeFCTriggerRequest, runtime: $RuntimeOptions): DescribeFCTriggerResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeFCTrigger',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a specified Function Compute trigger.
 *
 * @param request DescribeFCTriggerRequest
 * @return DescribeFCTriggerResponse
 */
async function describeFCTrigger(request: DescribeFCTriggerRequest): DescribeFCTriggerResponse {
  var runtime = new $RuntimeOptions{};
  return describeFCTriggerWithOptions(request, runtime);
}

model DescribeIpInfoRequest {
  IP?: string(name='IP', description='The IP address. You can specify only one IP address.

This parameter is required.', example='192.168.0.1'),
}

model DescribeIpInfoResponseBody = {
  cdnIp?: string(name='CdnIp', description='Indicates whether the IP address belongs to an Alibaba Cloud CDN POP.
*   **True**:Yes.
*   **False**:No.', example='True'),
  ISP?: string(name='ISP', description='The name of the ISP in Chinese.', example='电信'),
  ispEname?: string(name='IspEname', description='The name of the ISP.', example='telecom'),
  region?: string(name='Region', description='The name of the region in Chinese.', example='中国-贵州省-贵阳市'),
  regionEname?: string(name='RegionEname', description='The name of the region.', example='China-Guizhou-guiyang'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='123847FA-9A00-4426-83B8-B4B45D475930'),
}

model DescribeIpInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIpInfoResponseBody(name='body'),
}

/**
 * @summary Checks whether a specified IP address is the IP address of a CDN point of presence (POP).
 *
 * @param request DescribeIpInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIpInfoResponse
 */
async function describeIpInfoWithOptions(request: DescribeIpInfoRequest, runtime: $RuntimeOptions): DescribeIpInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.IP)) {
    query['IP'] = request.IP;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeIpInfo',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Checks whether a specified IP address is the IP address of a CDN point of presence (POP).
 *
 * @param request DescribeIpInfoRequest
 * @return DescribeIpInfoResponse
 */
async function describeIpInfo(request: DescribeIpInfoRequest): DescribeIpInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeIpInfoWithOptions(request, runtime);
}

model DescribeIpStatusRequest {
  ips?: string(name='Ips', description='The IP addresses that you want to query. Separate IP addresses with underscores (_), such as Ips=ip1_ip2.

This parameter is required.', example='ip1_ip2'),
}

model DescribeIpStatusResponseBody = {
  ipStatus?: [ 
    {
      ip?: string(name='ip', description='The IP address of the POP.', example='10.10.10.10'),
      status?: string(name='status', description='The status.

*   **nonali**: not an Alibaba Cloud CDN POP
*   **normal**: an available Alibaba Cloud CDN POP
*   **abnormal**: an unavailable Alibaba Cloud CDN POP', example='abnormal'),
    }
  ](name='IpStatus', description='The status of the IP addresses of the POPs.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F61CDR30-E83C-4FDA-BF73-9A94CDD44229'),
}

model DescribeIpStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIpStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of IP addresses of points of presence (POPs). The status of an IP address of a POP indicates whether content delivery acceleration is supported by the POP.
 *
 * @description > You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeIpStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIpStatusResponse
 */
async function describeIpStatusWithOptions(request: DescribeIpStatusRequest, runtime: $RuntimeOptions): DescribeIpStatusResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeIpStatus',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the status of IP addresses of points of presence (POPs). The status of an IP address of a POP indicates whether content delivery acceleration is supported by the POP.
 *
 * @description > You can call this operation up to 50 times per second per account.
 *
 * @param request DescribeIpStatusRequest
 * @return DescribeIpStatusResponse
 */
async function describeIpStatus(request: DescribeIpStatusRequest): DescribeIpStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeIpStatusWithOptions(request, runtime);
}

model DescribeL2VipsByDomainRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeL2VipsByDomainResponseBody = {
  domainName?: string(name='DomainName', description='The domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
  vips?: {
    vip?: [ string ](name='Vip')
  }(name='Vips', description='The list of VIPs.'),
}

model DescribeL2VipsByDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeL2VipsByDomainResponseBody(name='body'),
}

/**
 * @summary Queries the virtual IP addresses (VIPs) of L2 CDN points of presence (POPs) for a specific domain name.
 *
 * @description *   This operation is available only to users whose daily peak bandwidth value is higher than 1 Gbit/s. If you meet this requirement, you can [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex) to apply for permissions to use this operation.
 * *   You can call this operation up to 40 times per second per account.
 *
 * @param request DescribeL2VipsByDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeL2VipsByDomainResponse
 */
async function describeL2VipsByDomainWithOptions(request: DescribeL2VipsByDomainRequest, runtime: $RuntimeOptions): DescribeL2VipsByDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeL2VipsByDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the virtual IP addresses (VIPs) of L2 CDN points of presence (POPs) for a specific domain name.
 *
 * @description *   This operation is available only to users whose daily peak bandwidth value is higher than 1 Gbit/s. If you meet this requirement, you can [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex) to apply for permissions to use this operation.
 * *   You can call this operation up to 40 times per second per account.
 *
 * @param request DescribeL2VipsByDomainRequest
 * @return DescribeL2VipsByDomainResponse
 */
async function describeL2VipsByDomain(request: DescribeL2VipsByDomainRequest): DescribeL2VipsByDomainResponse {
  var runtime = new $RuntimeOptions{};
  return describeL2VipsByDomainWithOptions(request, runtime);
}

model DescribePreloadDetailByIdRequest {
  taskId?: string(name='TaskId', description='Queries the details of a preload task by task ID. You can query one task ID at a time.

This parameter is required.', example='15423123921'),
}

model DescribePreloadDetailByIdResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request. You can use the ID to query logs and troubleshoot issues.', example='E9D3257A-1B7C-414C-90C1-8D07AC47BCAC'),
  totalCount?: long(name='TotalCount', description='The number of queried tasks.', example='1'),
  urlDetails?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the task was created. The time is displayed in UTC.', example='2022-11-23T02:26:56Z'),
      domain?: string(name='Domain', description='The domain name for prefetching resources.', example='example.com'),
      endTime?: string(name='EndTime', description='The time when the task ended. The time is displayed in UTC.', example='2022-11-23T02:27:00Z'),
      process?: string(name='Process', description='The progress of the prefetch task, which indicates the number of points of presence (POPs) on which the prefetch task is completed.', example='100%'),
      retCode?: string(name='RetCode', description='The turned error code. A value of `0` indicates that the task succeeded.', example='0'),
      status?: string(name='Status', description='The status of the task. Valid values:

*   **Complete**
*   **Refreshing**
*   **Failed**', example='Complete'),
      taskId?: string(name='TaskId', description='The ID of the task that you want to query.

You can call the PushObjectCache operation to query task IDs. Then, you can use the task IDs to query task status.

You can query one task ID at a time.', example='14286878547'),
      urls?: [ 
        {
          description?: string(name='Description', description='The details of resource prefetch.

*   If the resource is prefetched on all POPs, "Successfully preloaded" is returned.
*   If the resource fails to be prefetched on some POPs, the failure details separated by vertical bars (|) are returned.', example='Successfully preloaded'),
          success?: string(name='Success', description='The success percentage, which indicates the number of POPs on which the resource is prefetched.', example='47%'),
          url?: string(name='Url', description='The URL of the prefetched resource.', example='/abc.jpg'),
        }
      ](name='Urls', description='The completion details of all URL resources in the task.'),
    }
  ](name='UrlDetails', description='The details of the task, including the task ID, start time, end time, domain name, success rate, status, returned error code, and completion details of all URL resources.'),
}

model DescribePreloadDetailByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePreloadDetailByIdResponseBody(name='body'),
}

/**
 * @summary Queries the prefetch details of a task, including the prefetch progress of all resources in the task. Only users who are included in the whitelist can use this operation. You can contact your business manager to apply for the whitelist.
 *
 * @description *   You can query data within the last 3 days.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribePreloadDetailByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePreloadDetailByIdResponse
 */
async function describePreloadDetailByIdWithOptions(request: DescribePreloadDetailByIdRequest, runtime: $RuntimeOptions): DescribePreloadDetailByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePreloadDetailById',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the prefetch details of a task, including the prefetch progress of all resources in the task. Only users who are included in the whitelist can use this operation. You can contact your business manager to apply for the whitelist.
 *
 * @description *   You can query data within the last 3 days.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribePreloadDetailByIdRequest
 * @return DescribePreloadDetailByIdResponse
 */
async function describePreloadDetailById(request: DescribePreloadDetailByIdRequest): DescribePreloadDetailByIdResponse {
  var runtime = new $RuntimeOptions{};
  return describePreloadDetailByIdWithOptions(request, runtime);
}

model DescribeRangeDataByLocateAndIspServiceRequest {
  domainNames?: string(name='DomainNames', description='The accelerated domain name.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time. The maximum time range that can be specified is 1 hour.

This parameter is required.', example='2019-11-30T05:40:00Z'),
  ispNames?: string(name='IspNames', description='The name of the ISP. You can specify only one ISP name in each call.

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query ISPs.', example='unicom'),
  locationNames?: string(name='LocationNames', description='The names of the regions. Separate multiple region names with commas (,).

You can call the [DescribeCdnRegionAndIsp](https://help.aliyun.com/document_detail/91077.html) operation to query the most recent region list.', example='liaoning,guangxi'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2019-11-30T05:33:00Z'),
}

model DescribeRangeDataByLocateAndIspServiceResponseBody = {
  jsonResult?: string(name='JsonResult', description='The response parameters in the JSON format. These parameters indicate the following information in sequence: UNIX time, region, ISP, distribution of HTTP status codes, response time, bandwidth (bit/s), average response rate, page views, cache hit ratio, and request hit ratio.', example='{"1472659200":{"Tianjin":{"China Telecom":{"http_codes":{"000":0,"200":6,"400":0},"rt":4183,"bandwidth":46639,"avg_speed":7773,"pv":6,"hit_rate":0.93,"request_hit_rate":0.66}}}}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model DescribeRangeDataByLocateAndIspServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRangeDataByLocateAndIspServiceResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth values by Internet service provider (ISP) and region.
 *
 * @description *   The data is collected every 5 minutes.
 * *   You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeRangeDataByLocateAndIspServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRangeDataByLocateAndIspServiceResponse
 */
async function describeRangeDataByLocateAndIspServiceWithOptions(request: DescribeRangeDataByLocateAndIspServiceRequest, runtime: $RuntimeOptions): DescribeRangeDataByLocateAndIspServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNames)) {
    query['IspNames'] = request.ispNames;
  }
  if (!$isNull(request.locationNames)) {
    query['LocationNames'] = request.locationNames;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRangeDataByLocateAndIspService',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the bandwidth values by Internet service provider (ISP) and region.
 *
 * @description *   The data is collected every 5 minutes.
 * *   You can call this operation up to 20 times per second per account.
 *
 * @param request DescribeRangeDataByLocateAndIspServiceRequest
 * @return DescribeRangeDataByLocateAndIspServiceResponse
 */
async function describeRangeDataByLocateAndIspService(request: DescribeRangeDataByLocateAndIspServiceRequest): DescribeRangeDataByLocateAndIspServiceResponse {
  var runtime = new $RuntimeOptions{};
  return describeRangeDataByLocateAndIspServiceWithOptions(request, runtime);
}

model DescribeRealtimeDeliveryAccRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

The end time must be later than the start time.', example='2016-10-20T05:00:00Z'),
  interval?: string(name='Interval', description='The time granularity of the data entries. Unit: seconds. The value varies based on the values of the **StartTime** and **EndTime** parameters. Valid values:

*   If the time span between StartTime and EndTime is less than 3 days, valid values are **300**, **3600**, and **86400**. Default value: **300**.
*   If the time span between StartTime and EndTime is greater than or equal to 3 days and less than 31 days, valid values are **3600** and **86400**. Default value: **3600**.
*   If the time span between StartTime and EndTime is 31 days or longer, the valid value is **86400**. Default value: **86400**.', example='300'),
  logStore?: string(name='LogStore', description='The name of the Logstore that stores log data. If you do leave this parameter empty, real-time log deliveries of all Logstores are queried.', example='LogStore'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery. If you do leave this parameter empty, real-time log deliveries of all projects are queried.', example='Project'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2016-10-20T04:00:00Z'),
}

model DescribeRealtimeDeliveryAccResponseBody = {
  reatTimeDeliveryAccData?: {
    accData?: [ 
    {
      failedNum?: int32(name='FailedNum', description='The number of failed attempts to deliver log data to Log Service.', example='2'),
      successNum?: int32(name='SuccessNum', description='The number of successful deliveries of log data to Log Service.', example='2'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned.', example='2018-09-03T06:00:00Z'),
    }
  ](name='AccData')
  }(name='ReatTimeDeliveryAccData', description='The statistics about real-time log deliveries.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='684306D2-2511-4977-991D-CE97E91FD7C0'),
}

model DescribeRealtimeDeliveryAccResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRealtimeDeliveryAccResponseBody(name='body'),
}

/**
 * @summary Queries the number of real-time log deliveries.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeRealtimeDeliveryAccRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRealtimeDeliveryAccResponse
 */
async function describeRealtimeDeliveryAccWithOptions(request: DescribeRealtimeDeliveryAccRequest, runtime: $RuntimeOptions): DescribeRealtimeDeliveryAccResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.logStore)) {
    query['LogStore'] = request.logStore;
  }
  if (!$isNull(request.project)) {
    query['Project'] = request.project;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRealtimeDeliveryAcc',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of real-time log deliveries.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeRealtimeDeliveryAccRequest
 * @return DescribeRealtimeDeliveryAccResponse
 */
async function describeRealtimeDeliveryAcc(request: DescribeRealtimeDeliveryAccRequest): DescribeRealtimeDeliveryAccResponse {
  var runtime = new $RuntimeOptions{};
  return describeRealtimeDeliveryAccWithOptions(request, runtime);
}

model DescribeRefreshQuotaRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeRefreshQuotaResponseBody = {
  blockQuota?: string(name='BlockQuota', description='The maximum number of URLs that can be refreshed on the current day.', example='300'),
  blockRemain?: string(name='BlockRemain', description='The remaining number of times that you can prefetch content to L2 points of presence (POPs) on the current day.', example='100'),
  dirQuota?: string(name='DirQuota', description='The ID of the request.', example='100'),
  dirRemain?: string(name='DirRemain', description='The remaining number of URLs that can be refreshed on the current day.', example='99'),
  ignoreParamsQuota?: string(name='IgnoreParamsQuota', description='The maximum number of URLs or directories with parameters ignored that can be refreshed on the current day.', example='100'),
  ignoreParamsRemain?: string(name='IgnoreParamsRemain', description='The number of remaining URLs or directories that can be refreshed with parameters ignored on the current day.', example='10'),
  preloadEdgeQuota?: string(name='PreloadEdgeQuota', description='The maximum number of directories that can be refreshed on the current day.', example='20'),
  preloadEdgeRemain?: string(name='PreloadEdgeRemain', description='The maximum number of times that you can prefetch content to L1 POPs on the current day.', example='20'),
  preloadQuota?: string(name='PreloadQuota', description='The remaining number of times that you can prefetch content to L1 POPs on the current day.', example='500'),
  preloadRemain?: string(name='PreloadRemain', description='The maximum number of times that you can prefetch content to L1 nodes on the current day.', example='400'),
  regexQuota?: string(name='RegexQuota', description='The maximum number of times that you can prefetch content to L2 POPs on the current day.', example='20'),
  regexRemain?: string(name='RegexRemain', description='The remaining number of URLs that can be blocked on the current day.', example='10'),
  requestId?: string(name='RequestId', description='The maximum number of URLs and directories that can be blocked on the current day.', example='42E0554B-80F4-4921-AED6-ACFB22CAAAD0'),
  urlQuota?: string(name='UrlQuota', description='The remaining number of directories that can be refreshed on the current day.', example='2000'),
  urlRemain?: string(name='UrlRemain', description='The remaining number of URLs or directories that can be refreshed by using regular expressions on the current day.', example='1996'),
}

model DescribeRefreshQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRefreshQuotaResponseBody(name='body'),
}

/**
 * @summary DescribeRefreshQuota
 *
 * @description Queries the maximum and remaining numbers of URLs and directories that can be refreshed, the maximum and remaining numbers of times that you can prefetch content, and the maximum and remaining numbers of URLs and directories that can be blocked on the current day.
 *
 * @param request DescribeRefreshQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRefreshQuotaResponse
 */
async function describeRefreshQuotaWithOptions(request: DescribeRefreshQuotaRequest, runtime: $RuntimeOptions): DescribeRefreshQuotaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRefreshQuota',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary DescribeRefreshQuota
 *
 * @description Queries the maximum and remaining numbers of URLs and directories that can be refreshed, the maximum and remaining numbers of times that you can prefetch content, and the maximum and remaining numbers of URLs and directories that can be blocked on the current day.
 *
 * @param request DescribeRefreshQuotaRequest
 * @return DescribeRefreshQuotaResponse
 */
async function describeRefreshQuota(request: DescribeRefreshQuotaRequest): DescribeRefreshQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return describeRefreshQuotaWithOptions(request, runtime);
}

model DescribeRefreshTaskByIdRequest {
  taskId?: string(name='TaskId', description='The ID of the task that you want to query.

You can call the [RefreshObjectCaches](https://help.aliyun.com/document_detail/91164.html) operation to query task IDs. Then, you can use the task IDs to query task status.

You can specify up to 10 task IDs. Separate task IDs with commas (,).

This parameter is required.', example='12345678'),
}

model DescribeRefreshTaskByIdResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E0C2EF95-B1EC-4C93-855E-2059A7DA2B7B'),
  tasks?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the task was created. The time is displayed in UTC.', example='2020-08-03T08:54:23Z'),
      description?: string(name='Description', description='The error returned when the refresh or prefetch task failed. Valid values:

*   **Internal Error**
*   **Origin Timeout**
*   **Origin Return StatusCode 5XX**', example='Internal Error'),
      objectPath?: string(name='ObjectPath', description='The path of the object refreshed by the refresh task.', example='http://example.com/abc.jpg'),
      objectType?: string(name='ObjectType', description='The type of the task. Valid values:

*   **file**: refreshes an individual file.
*   **directory**: refreshes files in the specified directory.
*   **preload**: prefetches an individual file.
*   **regex**: refreshes content based on a regular expression.', example='file'),
      process?: string(name='Process', description='The progress of the task, in percentage.', example='100%'),
      status?: string(name='Status', description='The status of the task. Valid values:

*   **Complete**
*   **Pending**
*   **Refreshing**
*   **Failed**', example='Complete'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='24840'),
    }
  ](name='Tasks', description='Details about tasks.'),
  totalCount?: long(name='TotalCount', description='The total number of tasks.', example='2'),
}

model DescribeRefreshTaskByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRefreshTaskByIdResponseBody(name='body'),
}

/**
 * @summary Queries the statuses of refresh or prefetch tasks by task ID.
 *
 * @description *   You can query data in the last three days.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeRefreshTaskByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRefreshTaskByIdResponse
 */
async function describeRefreshTaskByIdWithOptions(request: DescribeRefreshTaskByIdRequest, runtime: $RuntimeOptions): DescribeRefreshTaskByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRefreshTaskById',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the statuses of refresh or prefetch tasks by task ID.
 *
 * @description *   You can query data in the last three days.
 * *   You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeRefreshTaskByIdRequest
 * @return DescribeRefreshTaskByIdResponse
 */
async function describeRefreshTaskById(request: DescribeRefreshTaskByIdRequest): DescribeRefreshTaskByIdResponse {
  var runtime = new $RuntimeOptions{};
  return describeRefreshTaskByIdWithOptions(request, runtime);
}

model DescribeRefreshTasksRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one accelerated domain name in each call. By default, this operation queries the status of tasks for all accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2017-12-22T08:00:00Z'),
  objectPath?: string(name='ObjectPath', description='The path of the object. The path is used as a condition for exact matching.', example='http://example.com/1.txt'),
  objectType?: string(name='ObjectType', description='The type of the task. Valid values:

*   **file**: refreshes one or more files.
*   **directory**: refreshes files in specific directories.
*   **regex**: refreshes content based on a regular expression.
*   **preload**: prefetches one or more files.

> If you set the **DomainName** or **Status** parameter, you must also set the **ObjectType** parameter.', example='file'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Valid values: **1** to **100000**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: **20**. Maximum value: **100**. Valid values: **1** to **100**.', example='20'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyuji4b6r4**'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The start of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-12-21T08:00:00Z'),
  status?: string(name='Status', description='The status of the task. Valid values:

*   **Complete**: The task is complete.
*   **Refreshing**: The task is in progress.
*   **Failed**: The task failed.', example='Complete'),
  taskId?: string(name='TaskId', description='The ID of the task that you want to query.', example='1234321'),
}

model DescribeRefreshTasksResponseBody = {
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='10'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='174F6032-AA26-470D-B90E-36F0EB205BEE'),
  tasks?: {
    CDNTask?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the task was created. The time is displayed in UTC.', example='2014-11-27T08:23:22Z'),
      description?: string(name='Description', description='The type of the error returned when the refresh or prefetch task failed. Valid values:

*   **InternalError**: An internal error occurred.
*   **OriginTimeout**: The response from the origin server timed out.
*   **OriginReturnStatusCode 5XX**: The origin server returned a 5XX error.', example='Internal Error'),
      objectPath?: string(name='ObjectPath', description='The URL of the object refreshed.', example='http://example.com/1.txt'),
      objectType?: string(name='ObjectType', description='The type of the task.

*   **file**: refreshes one or more files.
*   **directory**: refreshes files in the specified directories.
*   **regex**: refreshes content based on a regular expression.
*   **preload**: prefetches one or more files.', example='file'),
      process?: string(name='Process', description='The progress of the task, in percentage.', example='100%'),
      status?: string(name='Status', description='The status of the task. Valid values:

*   **Complete**: The task has completed.
*   **Refreshing**: The task is in progress.
*   **Failed**: The task failed.', example='Complete'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='704225667'),
    }
  ](name='CDNTask')
  }(name='Tasks', description='Details about tasks.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model DescribeRefreshTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRefreshTasksResponseBody(name='body'),
}

/**
 * @summary Queries the status of refresh or prefetch tasks that belong to an accelerated domain name.
 *
 * @description *   You can query the status of tasks by task ID or URL.
 * *   You can set both the **TaskId** and **ObjectPath** parameters. If you do not set the **TaskId** or **ObjectPath** parameter, data entries on the first page (20 entries) collected in the last 3 days are returned.
 * *   You can query data collected in the last 3 days.
 * *   If auto CDN cache update is enabled in the Object Storage Service (OSS) console, you cannot call the DescribeRefreshTasks operation to query automatic refresh tasks in OSS.
 * *   You can call this operation up to 10 times per second per account. If you want to query tasks at a higher frequency, call the [DescribeRefreshTaskById](https://help.aliyun.com/document_detail/187709.html) operation. This operation allows you to query tasks by task ID.
 *
 * @param request DescribeRefreshTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRefreshTasksResponse
 */
async function describeRefreshTasksWithOptions(request: DescribeRefreshTasksRequest, runtime: $RuntimeOptions): DescribeRefreshTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!$isNull(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRefreshTasks',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the status of refresh or prefetch tasks that belong to an accelerated domain name.
 *
 * @description *   You can query the status of tasks by task ID or URL.
 * *   You can set both the **TaskId** and **ObjectPath** parameters. If you do not set the **TaskId** or **ObjectPath** parameter, data entries on the first page (20 entries) collected in the last 3 days are returned.
 * *   You can query data collected in the last 3 days.
 * *   If auto CDN cache update is enabled in the Object Storage Service (OSS) console, you cannot call the DescribeRefreshTasks operation to query automatic refresh tasks in OSS.
 * *   You can call this operation up to 10 times per second per account. If you want to query tasks at a higher frequency, call the [DescribeRefreshTaskById](https://help.aliyun.com/document_detail/187709.html) operation. This operation allows you to query tasks by task ID.
 *
 * @param request DescribeRefreshTasksRequest
 * @return DescribeRefreshTasksResponse
 */
async function describeRefreshTasks(request: DescribeRefreshTasksRequest): DescribeRefreshTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeRefreshTasksWithOptions(request, runtime);
}

model DescribeStagingIpResponseBody = {
  IPV4s?: {
    IPV4?: [ string ](name='IPV4')
  }(name='IPV4s', description='IPv4 addresses.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1B9E0E83-24AC-49F4-9EE0-BF5EB03E8381'),
}

model DescribeStagingIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeStagingIpResponseBody(name='body'),
}

/**
 * @summary Queries node IP addresses in the staging environment.
 *
 * @description >The maximum number of times that each user can call this operation per second is 30.
 *
 * @param request DescribeStagingIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeStagingIpResponse
 */
async function describeStagingIpWithOptions(runtime: $RuntimeOptions): DescribeStagingIpResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeStagingIp',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries node IP addresses in the staging environment.
 *
 * @description >The maximum number of times that each user can call this operation per second is 30.
 *
 * @return DescribeStagingIpResponse
 */
async function describeStagingIp(): DescribeStagingIpResponse {
  var runtime = new $RuntimeOptions{};
  return describeStagingIpWithOptions(runtime);
}

model DescribeTagResourcesRequest {
  resourceId?: [ string ](name='ResourceId', description='The IDs of the resources. You can specify up to 50 IDs in each request.

This parameter is required.', example='1'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **DOMAIN**.

This parameter is required.', example='DOMAIN'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. Valid values of N: **1** to **20**.', example='key'),
      value?: string(name='Value', description='The value of the tag. Valid values of N: **1** to **20**.', example='value'),
    }
  ](name='Tag', description='The tags. You can specify up to 20 tags in each request.'),
}

model DescribeTagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='34AB41F1-04A5-496F-8C8D-634BDBE6A9FB'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='example.com'),
      tag?: [ 
        {
          key?: string(name='Key', description='The key of the tag.', example='env'),
          value?: string(name='Value', description='The value of the tag.', example='product'),
        }
      ](name='Tag', description='The key-value pair of the tag.'),
    }
  ](name='TagResources', description='The tags that are attached to the specified resource.'),
}

model DescribeTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries tags that are added to specified resources.
 *
 * @description >  The maximum number of times that each user can call this operation per second is 10.
 *
 * @param request DescribeTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagResourcesResponse
 */
async function describeTagResourcesWithOptions(request: DescribeTagResourcesRequest, runtime: $RuntimeOptions): DescribeTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTagResources',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries tags that are added to specified resources.
 *
 * @description >  The maximum number of times that each user can call this operation per second is 10.
 *
 * @param request DescribeTagResourcesRequest
 * @return DescribeTagResourcesResponse
 */
async function describeTagResources(request: DescribeTagResourcesRequest): DescribeTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return describeTagResourcesWithOptions(request, runtime);
}

model DescribeTopDomainsByFlowRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-12-23T08:00:00Z'),
  limit?: long(name='Limit', description='The maximum number of domain names to query. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The value of StartTime must be in UTC. For example, if the local time is 00:00 on June 1, 2021, set StartTime to 2021-05-31T16:00:00Z.', example='2019-12-22T08:00:00Z'),
}

model DescribeTopDomainsByFlowResponseBody = {
  domainCount?: long(name='DomainCount', description='The total number of accelerated domain names that belong to the current Alibaba Cloud account.', example='68'),
  domainOnlineCount?: long(name='DomainOnlineCount', description='The total number of accelerated domain names that are in the **Enabled** state within the current Alibaba Cloud account.', example='68'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2019-12-23T08:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4E09C5D7-E1CF-4CAA-A45E-8727F4C8FD70'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-22T08:00:00Z'),
  topDomains?: {
    topDomain?: [ 
    {
      domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
      maxBps?: float(name='MaxBps', description='The peak bandwidth value.', example='22139626'),
      maxBpsTime?: string(name='MaxBpsTime', description='The time when the bandwidth reached the peak value.', example='1457111400'),
      rank?: long(name='Rank', description='The ranking of the accelerated domain name.', example='1'),
      totalAccess?: long(name='TotalAccess', description='The number of visits to the domain name.', example='107784230'),
      totalTraffic?: string(name='TotalTraffic', description='The total volume of traffic.', example='2043859876683.9001'),
      trafficPercent?: string(name='TrafficPercent', description='The proportion of network traffic consumed to access the domain name.', example='30.64191989360235'),
    }
  ](name='TopDomain')
  }(name='TopDomains', description='The top N domain names ranked by network traffic.'),
}

model DescribeTopDomainsByFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTopDomainsByFlowResponseBody(name='body'),
}

/**
 * @summary Queries the top N domain names ranked by network traffic. You can query data collected in the last 30 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not set the **StartTime** or **EndTime** parameter, the request returns the data collected in the current month. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeTopDomainsByFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTopDomainsByFlowResponse
 */
async function describeTopDomainsByFlowWithOptions(request: DescribeTopDomainsByFlowRequest, runtime: $RuntimeOptions): DescribeTopDomainsByFlowResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTopDomainsByFlow',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the top N domain names ranked by network traffic. You can query data collected in the last 30 days.
 *
 * @description The statistical analysis feature of Alibaba Cloud CDN is no longer available. The API operations related to the statistical analysis feature are no longer maintained. We recommend that you do not use the API operations because data may be missing or inaccurate. You can use the [operations report](https://help.aliyun.com/document_detail/279577.html) feature for data analysis.
 * > *   If you do not set the **StartTime** or **EndTime** parameter, the request returns the data collected in the current month. If you set both these parameters, the request returns the data collected within the specified time range.
 * >*   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeTopDomainsByFlowRequest
 * @return DescribeTopDomainsByFlowResponse
 */
async function describeTopDomainsByFlow(request: DescribeTopDomainsByFlowRequest): DescribeTopDomainsByFlowResponse {
  var runtime = new $RuntimeOptions{};
  return describeTopDomainsByFlowWithOptions(request, runtime);
}

model DescribeUserCdnStatusRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeUserCdnStatusResponseBody = {
  enabled?: boolean(name='Enabled', description='Indicates whetherAlibaba Cloud CDN is activated.', example='true'),
  inDebt?: boolean(name='InDebt', description='Indicates whether your account has overdue payments.

*   true
*   false', example='false'),
  inDebtOverdue?: boolean(name='InDebtOverdue', description='Indicates whether the grace period for your overdue payments expired.', example='false'),
  onService?: boolean(name='OnService', description='Indicates whether the service is available.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='39B1DC7F-9D25-5D54-8F02-6EE26A7F48CA'),
}

model DescribeUserCdnStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserCdnStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of a user.
 *
 * @param request DescribeUserCdnStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserCdnStatusResponse
 */
async function describeUserCdnStatusWithOptions(request: DescribeUserCdnStatusRequest, runtime: $RuntimeOptions): DescribeUserCdnStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserCdnStatus',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the status of a user.
 *
 * @param request DescribeUserCdnStatusRequest
 * @return DescribeUserCdnStatusResponse
 */
async function describeUserCdnStatus(request: DescribeUserCdnStatusRequest): DescribeUserCdnStatusResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserCdnStatusWithOptions(request, runtime);
}

model DescribeUserCertificateExpireCountResponseBody = {
  expireWithin30DaysCount?: int32(name='ExpireWithin30DaysCount', description='The number of domain names whose SSL certificates are about to expires within 30 days.', example='0'),
  expiredCount?: int32(name='ExpiredCount', description='The number of domain names whose SSL certificates have already expired.', example='6'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F5E8DF64-7175-4186-9B06-F002C0BBD0C5'),
}

model DescribeUserCertificateExpireCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserCertificateExpireCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of domain names whose SSL certificates are about to expire or have already expired.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeUserCertificateExpireCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserCertificateExpireCountResponse
 */
async function describeUserCertificateExpireCountWithOptions(runtime: $RuntimeOptions): DescribeUserCertificateExpireCountResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserCertificateExpireCount',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of domain names whose SSL certificates are about to expire or have already expired.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @return DescribeUserCertificateExpireCountResponse
 */
async function describeUserCertificateExpireCount(): DescribeUserCertificateExpireCountResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserCertificateExpireCountWithOptions(runtime);
}

model DescribeUserConfigsRequest {
  config?: string(name='Config', description='The feature whose configurations you want to query. You can specify only one feature in each request. Valid values: oss, green_manager, waf, cc_rule, ddos_dispatch, edge_safe, blocked_regions, http_acl_policy, bot_manager, and ip_reputation.

This parameter is required.', example='oss'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeUserConfigsResponseBody = {
  configs?: {
    ossLogConfig?: {
      bucket?: string(name='Bucket', description='The name of the bucket.', example='Buckettest'),
      enable?: string(name='Enable', description='Indicates whether the OSS bucket is enabled.', example='off'),
      prefix?: string(name='Prefix', description='The prefix.', example='test'),
    }(name='OssLogConfig', description='The configurations of Object Storage Service (OSS).'),
    wafConfig?: {
      enable?: string(name='Enable', description='Indicates whether WAF is enabled.', example='on'),
    }(name='WafConfig', description='The configurations of Web Application Firewall (WAF).'),
  }(name='Configs', description='The configurations of the specified feature.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9BCC7BAA-ACBE-45E5-83F0-98BF7E693E84'),
}

model DescribeUserConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserConfigsResponseBody(name='body'),
}

/**
 * @summary Queries configurations of security features.
 *
 * @param request DescribeUserConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserConfigsResponse
 */
async function describeUserConfigsWithOptions(request: DescribeUserConfigsRequest, runtime: $RuntimeOptions): DescribeUserConfigsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.config)) {
    query['Config'] = request.config;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserConfigs',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries configurations of security features.
 *
 * @param request DescribeUserConfigsRequest
 * @return DescribeUserConfigsResponse
 */
async function describeUserConfigs(request: DescribeUserConfigsRequest): DescribeUserConfigsResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserConfigsWithOptions(request, runtime);
}

model DescribeUserDomainsRequest {
  cdnType?: string(name='CdnType', description='The type of workload accelerated by Alibaba Cloud CDN. Separate types with commas (,). Valid values:

*   **web**: images and small files
*   **download**: large files
*   **video**: on-demand video and audio streaming

If you do not set this parameter, all service types are queried.', example='download,web,video'),
  changeEndTime?: string(name='ChangeEndTime', description='The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> The end time must be later than the start time.', example='2019-10-10T12:14:58Z'),
  changeStartTime?: string(name='ChangeStartTime', description='The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-10-10T12:14:55Z'),
  checkDomainShow?: boolean(name='CheckDomainShow', description='Specifies whether to display domain names that are under review, failed the review, or failed to be configured. Valid values:

*   **true**
*   **false**', example='false'),
  coverage?: string(name='Coverage', description='The acceleration region. By default, all acceleration regions are queried. Valid values:

*   **domestic**: Chinese mainland
*   **global**: global
*   **overseas**: outside the Chinese mainland', example='domestic'),
  domainName?: string(name='DomainName', description='The accelerated domain. If you do not set this parameter, all domain names that match the conditions are returned.', example='example.com'),
  domainSearchType?: string(name='DomainSearchType', description='The search mode. Valid values:

*   **fuzzy_match**: fuzzy match
*   **pre_match**: prefix match
*   **suf_match**: suffix match
*   **full_match** (default): exact match

> If you specify the domain names to query but do not set the DomainSearchType parameter, the exact match mode is used.', example='fuzzy_match'),
  domainStatus?: string(name='DomainStatus', description='The status of the domain name. Valid values:

*   **online**
*   **offline**
*   **configuring**
*   **configure_failed**
*   **checking**
*   **check_failed**
*   **stopping**
*   **deleting**

If you do not set this parameter, domain names in all states are queried.', example='configure_failed'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Valid values: **1** to **100000**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **1 to 500**. Default value: **20**. Maximum value: **500**.', example='5'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. By default, all IDs are queried.', example='abcd1234abcd1234'),
  securityToken?: string(name='SecurityToken'),
  source?: string(name='Source', description='The information about the origin server.', example='example.source.com'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of a tag.

By default, all tag keys are queried.', example='key'),
      value?: string(name='Value', description='The value of the tag.

By default, all tag values are queried.', example='value'),
    }
  ](name='Tag', description='The list of tags. Maximum number of elements in the list: 20'),
}

model DescribeUserDomainsResponseBody = {
  domains?: {
    pageData?: [ 
    {
      cdnType?: string(name='CdnType', description='The type of the workload accelerated by Alibaba Cloud CDN. Valid values:

*   **web**: images and small files
*   **download**: large files
*   **video**: on-demand video and audio streaming', example='download'),
      cname?: string(name='Cname', description='The CNAME assigned to the accelerated domain name.', example='example.com.w.alikunlun.net'),
      coverage?: string(name='Coverage', description='The acceleration region. Valid values:

*   **domestic**: Chinese mainland
*   **global**: global
*   **overseas**: outside the Chinese mainland', example='domestic'),
      description?: string(name='Description', description='The information about Internet Content Provider (ICP) filing.', example='filing description'),
      domainId?: long(name='DomainId', description='The ID of the accelerated domain name.', example='11223344'),
      domainName?: string(name='DomainName', description='The accelerated domain.', example='example.com'),
      domainStatus?: string(name='DomainStatus', description='The status of the accelerated domain name. Valid values:

*   **online**
*   **offline**
*   **configuring**
*   **configure_failed**
*   **checking**
*   **check_failed**
*   **stopping**
*   **deleting**', example='configure_failed'),
      gmtCreated?: string(name='GmtCreated', description='The time when the accelerated domain name was added.', example='2015-10-28T09:32:51Z'),
      gmtModified?: string(name='GmtModified', description='The time when the accelerated domain name was modified.', example='2015-10-28T11:05:52Z'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='abcd1234abcd1234'),
      sandbox?: string(name='Sandbox', description='Indicates whether the accelerated domain name is in a sandbox.', example='true'),
      sources?: {
        source?: [ 
        {
          content?: string(name='Content', description='The address of the origin server.', example='***.oss-cn-hangzhou.aliyuncs.com'),
          port?: int32(name='Port', description='The port of the origin server.', example='80'),
          priority?: string(name='Priority', description='The priority.', example='20'),
          type?: string(name='Type', description='The type of the origin server.', example='oss'),
          weight?: string(name='Weight', description='The weight of the origin server if multiple origin servers have been specified.', example='15'),
        }
      ](name='Source')
      }(name='Sources', description='The information about the origin server.'),
      sslProtocol?: string(name='SslProtocol', description='Indicates whether HTTPS is enabled. Valid values:

*   **on**
*   **off**', example='on'),
    }
  ](name='PageData')
  }(name='Domains', description='The list of the accelerated domain names returned.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BDA62CE4-3477-439A-B52E-D2D7C829D7C1'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model DescribeUserDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserDomainsResponseBody(name='body'),
}

/**
 * @summary Queries all accelerated domain names in your Alibaba Cloud account and the status of the accelerated domain names. You can filter domain names by name or status. Fuzzy match is supported.
 *
 * @description *   You can call this operation up to 100 times per second per account.
 * *   You can specify up to 50 domain names in each request. Separate multiple domain names with commas (,).
 *
 * @param request DescribeUserDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserDomainsResponse
 */
async function describeUserDomainsWithOptions(request: DescribeUserDomainsRequest, runtime: $RuntimeOptions): DescribeUserDomainsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cdnType)) {
    query['CdnType'] = request.cdnType;
  }
  if (!$isNull(request.changeEndTime)) {
    query['ChangeEndTime'] = request.changeEndTime;
  }
  if (!$isNull(request.changeStartTime)) {
    query['ChangeStartTime'] = request.changeStartTime;
  }
  if (!$isNull(request.checkDomainShow)) {
    query['CheckDomainShow'] = request.checkDomainShow;
  }
  if (!$isNull(request.coverage)) {
    query['Coverage'] = request.coverage;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.domainSearchType)) {
    query['DomainSearchType'] = request.domainSearchType;
  }
  if (!$isNull(request.domainStatus)) {
    query['DomainStatus'] = request.domainStatus;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.source)) {
    query['Source'] = request.source;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserDomains',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all accelerated domain names in your Alibaba Cloud account and the status of the accelerated domain names. You can filter domain names by name or status. Fuzzy match is supported.
 *
 * @description *   You can call this operation up to 100 times per second per account.
 * *   You can specify up to 50 domain names in each request. Separate multiple domain names with commas (,).
 *
 * @param request DescribeUserDomainsRequest
 * @return DescribeUserDomainsResponse
 */
async function describeUserDomains(request: DescribeUserDomainsRequest): DescribeUserDomainsResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserDomainsWithOptions(request, runtime);
}

model DescribeUserTagsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='34AB41F1-04A5-496F-8C8D-634BDBE6A9FB'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of a tag.', example='env'),
      value?: [ string ](name='Value', description='The tag values returned.'),
    }
  ](name='Tags', description='The tags.'),
}

model DescribeUserTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserTagsResponseBody(name='body'),
}

/**
 * @summary Queries user tags.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeUserTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserTagsResponse
 */
async function describeUserTagsWithOptions(runtime: $RuntimeOptions): DescribeUserTagsResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserTags',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries user tags.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @return DescribeUserTagsResponse
 */
async function describeUserTags(): DescribeUserTagsResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserTagsWithOptions(runtime);
}

model DescribeUserUsageDataExportTaskRequest {
  pageNumber?: string(name='PageNumber', description='The number of the page to return. Valid values: **1** to **100000**.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries to return on each page. Default value: **20**. Maximum value: **50**.

Valid values: an integer from **1** to **50**.', example='20'),
}

model DescribeUserUsageDataExportTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A91BE91F-0B34-4CBF-8E0F-A2977E15AA52'),
  usageDataPerPage?: {
    data?: {
      dataItem?: [ 
      {
        createTime?: string(name='CreateTime', description='The time when the task was created.', example='2019-12-31T08:43:21Z'),
        downloadUrl?: string(name='DownloadUrl', description='The download URL.', example='https://cdn-polaris.xxxx'),
        status?: string(name='Status', description='The state of the task.

*   created: The task is being created.
*   success: The task is successful.
*   failed: The task failed.', example='success'),
        taskConfig?: {
          endTime?: string(name='EndTime', description='The end of the time range that was queried.', example='2019-12-30T15:59:59Z'),
          startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2019-12-29T16:00:00Z'),
        }(name='TaskConfig', description='The configurations of the task.'),
        taskId?: string(name='TaskId', description='The ID of the task.', example='A91BE91F-0B34-4CBF-8E0F-A2977'),
        taskName?: string(name='TaskName', description='The name of the task.', example='Refresh'),
        updateTime?: string(name='UpdateTime', description='The time when the task was last modified.', example='2019-12-31T08:45:02Z'),
      }
    ](name='DataItem')
    }(name='Data', description='The information about the tasks.'),
    pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
  }(name='UsageDataPerPage', description='The usage details returned per page.'),
}

model DescribeUserUsageDataExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserUsageDataExportTaskResponseBody(name='body'),
}

/**
 * @summary Queries usage export tasks that were created in the last three months.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeUserUsageDataExportTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserUsageDataExportTaskResponse
 */
async function describeUserUsageDataExportTaskWithOptions(request: DescribeUserUsageDataExportTaskRequest, runtime: $RuntimeOptions): DescribeUserUsageDataExportTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserUsageDataExportTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries usage export tasks that were created in the last three months.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeUserUsageDataExportTaskRequest
 * @return DescribeUserUsageDataExportTaskResponse
 */
async function describeUserUsageDataExportTask(request: DescribeUserUsageDataExportTaskRequest): DescribeUserUsageDataExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserUsageDataExportTaskWithOptions(request, runtime);
}

model DescribeUserUsageDetailDataExportTaskRequest {
  pageNumber?: string(name='PageNumber', description='The number of the page to return. Valid values: **1** to **100000**.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries to return on each page. Default value: **20**. Maximum value: **50**.

Valid values: an integer from **1** to **50**.', example='10'),
}

model DescribeUserUsageDetailDataExportTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A91BE91F-0B34-4CBF-8E0F-A2977E15AA52'),
  usageDataPerPage?: {
    data?: {
      dataItem?: [ 
      {
        createTime?: string(name='CreateTime', description='The time when the task was created.', example='2018-10-09T06:33:38Z'),
        downloadUrl?: string(name='DownloadUrl', description='The download URL.', example='https://test.oss-cn-beijing.aliyuncs.com/billing_data/xxx'),
        status?: string(name='Status', description='The status of the task.', example='success'),
        taskConfig?: {
          endTime?: string(name='EndTime', description='The end of the time range during which data was queried.', example='2018-08-31T15:59:59Z'),
          startTime?: string(name='StartTime', description='The start of the time range during which data was queried.', example='2018-07-31T16:00:00Z'),
        }(name='TaskConfig', description='The configurations of the task.'),
        taskId?: string(name='TaskId', description='The ID of the task.', example='11'),
        taskName?: string(name='TaskName', description='The name of the task.', example='Refresh'),
        updateTime?: string(name='UpdateTime', description='The time when the task was last modified.', example='2018-10-09T06:35:46Z'),
      }
    ](name='DataItem')
    }(name='Data', description='The information about the task.'),
    pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
  }(name='UsageDataPerPage', description='The usage details returned per page.'),
}

model DescribeUserUsageDetailDataExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserUsageDetailDataExportTaskResponseBody(name='body'),
}

/**
 * @summary Queries tasks that were used to export resource usage details of one or more accelerated domain names that belong to your Alibaba Cloud account. Resource usage information is collected every five minutes.
 *
 * @description *   This operation has been available since July 20, 2018. You can query information about resource usage collected within the last three months.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeUserUsageDetailDataExportTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserUsageDetailDataExportTaskResponse
 */
async function describeUserUsageDetailDataExportTaskWithOptions(request: DescribeUserUsageDetailDataExportTaskRequest, runtime: $RuntimeOptions): DescribeUserUsageDetailDataExportTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserUsageDetailDataExportTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries tasks that were used to export resource usage details of one or more accelerated domain names that belong to your Alibaba Cloud account. Resource usage information is collected every five minutes.
 *
 * @description *   This operation has been available since July 20, 2018. You can query information about resource usage collected within the last three months.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request DescribeUserUsageDetailDataExportTaskRequest
 * @return DescribeUserUsageDetailDataExportTaskResponse
 */
async function describeUserUsageDetailDataExportTask(request: DescribeUserUsageDetailDataExportTaskRequest): DescribeUserUsageDetailDataExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserUsageDetailDataExportTaskWithOptions(request, runtime);
}

model DescribeUserVipsByDomainRequest {
  available?: string(name='Available', description='Specifies whether to query the virtual IP addresses of only healthy CDN POPs. Valid values:

*   **on**: healthy CDN edge nodes.
*   **off**: all CDN edge nodes.', example='on'),
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
}

model DescribeUserVipsByDomainResponseBody = {
  domainName?: string(name='DomainName', description='The domain name.', example='example.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='820E7900-5CA9-4AEF-B0DD-20ED5F64BE55'),
  vips?: {
    vip?: [ string ](name='Vip')
  }(name='Vips', description='The list of VIPs.'),
}

model DescribeUserVipsByDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserVipsByDomainResponseBody(name='body'),
}

/**
 * @summary Queries virtual IP addresses (VIPs) of CDN points of presence (POPs) by domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeUserVipsByDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserVipsByDomainResponse
 */
async function describeUserVipsByDomainWithOptions(request: DescribeUserVipsByDomainRequest, runtime: $RuntimeOptions): DescribeUserVipsByDomainResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserVipsByDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries virtual IP addresses (VIPs) of CDN points of presence (POPs) by domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request DescribeUserVipsByDomainRequest
 * @return DescribeUserVipsByDomainResponse
 */
async function describeUserVipsByDomain(request: DescribeUserVipsByDomainRequest): DescribeUserVipsByDomainResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserVipsByDomainWithOptions(request, runtime);
}

model DescribeVerifyContentRequest {
  domainName?: string(name='DomainName', description='The domain name of which the ownership was verified. You can specify only one domain name.

This parameter is required.', example='example.com'),
}

model DescribeVerifyContentResponseBody = {
  content?: string(name='Content', description='The verification content.', example='verify_dffeb6610035dcb77b413a59c32cd91f'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='34AB41F1-04A5-496F-8C8D-634BDBE6A9FB'),
}

model DescribeVerifyContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVerifyContentResponseBody(name='body'),
}

/**
 * @summary Queries the ownership verification content of an accelerated domain name.
 *
 * @param request DescribeVerifyContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVerifyContentResponse
 */
async function describeVerifyContentWithOptions(request: DescribeVerifyContentRequest, runtime: $RuntimeOptions): DescribeVerifyContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVerifyContent',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the ownership verification content of an accelerated domain name.
 *
 * @param request DescribeVerifyContentRequest
 * @return DescribeVerifyContentResponse
 */
async function describeVerifyContent(request: DescribeVerifyContentRequest): DescribeVerifyContentResponse {
  var runtime = new $RuntimeOptions{};
  return describeVerifyContentWithOptions(request, runtime);
}

model DisableRealtimeLogDeliveryRequest {
  domain?: string(name='Domain', description='The accelerated domain name for which you want to disable real-time log delivery. You can specify multiple domain names and separate them with commas (,).

This parameter is required.', example='example.com'),
  logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed.', example='cn-shanghai'),
}

model DisableRealtimeLogDeliveryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9732E117-8A37-49FD-A36F-ABBB87556CA7'),
}

model DisableRealtimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableRealtimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Disables real-time log delivery for specific accelerated domain names.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DisableRealtimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableRealtimeLogDeliveryResponse
 */
async function disableRealtimeLogDeliveryWithOptions(request: DisableRealtimeLogDeliveryRequest, runtime: $RuntimeOptions): DisableRealtimeLogDeliveryResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableRealtimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables real-time log delivery for specific accelerated domain names.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request DisableRealtimeLogDeliveryRequest
 * @return DisableRealtimeLogDeliveryResponse
 */
async function disableRealtimeLogDelivery(request: DisableRealtimeLogDeliveryRequest): DisableRealtimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return disableRealtimeLogDeliveryWithOptions(request, runtime);
}

model EnableRealtimeLogDeliveryRequest {
  domain?: string(name='Domain', description='The accelerated domain name for which you want to enable real-time log delivery. You can specify multiple domain names and separate them with commas (,).

This parameter is required.', example='example.com'),
  logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed.', example='cn-shanghai'),
}

model EnableRealtimeLogDeliveryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9732E117-8A37-49FD-A36F-ABBB87556CA7'),
}

model EnableRealtimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableRealtimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Enables real-time log delivery for an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request EnableRealtimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableRealtimeLogDeliveryResponse
 */
async function enableRealtimeLogDeliveryWithOptions(request: EnableRealtimeLogDeliveryRequest, runtime: $RuntimeOptions): EnableRealtimeLogDeliveryResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableRealtimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables real-time log delivery for an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request EnableRealtimeLogDeliveryRequest
 * @return EnableRealtimeLogDeliveryResponse
 */
async function enableRealtimeLogDelivery(request: EnableRealtimeLogDeliveryRequest): EnableRealtimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return enableRealtimeLogDeliveryWithOptions(request, runtime);
}

model GetGrayDomainFunctionRequest {
  domainName?: string(name='DomainName', description='This parameter is required.', example='example.com'),
  functionNames?: string(name='FunctionNames', example='domain_status,https_option'),
}

model GetGrayDomainFunctionResponseBody = {
  domainConfigList?: [ 
    {
      configId?: long(name='ConfigId', example='6295'),
      functionArgs?: [ 
        {
          argName?: string(name='ArgName', example='auth_type'),
          argValue?: string(name='ArgValue', example='req'),
        }
      ](name='FunctionArgs'),
      functionName?: string(name='FunctionName', example='ali_auth'),
      parentId?: string(name='ParentId', example='222728944812032'),
      status?: string(name='Status', example='success'),
    }
  ](name='DomainConfigList'),
  domainName?: string(name='DomainName', example='example.com'),
  progression?: string(name='Progression'),
  requestId?: string(name='RequestId', example='C80705BF-0F76-41FA-BAD1-5B59296A4E59'),
  status?: string(name='Status'),
}

model GetGrayDomainFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetGrayDomainFunctionResponseBody(name='body'),
}

/**
 * @summary 按域名、functionName查询灰度配置信息，返回的信息中包含当前的灰度状态、灰度进度
 *
 * @param request GetGrayDomainFunctionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetGrayDomainFunctionResponse
 */
async function getGrayDomainFunctionWithOptions(request: GetGrayDomainFunctionRequest, runtime: $RuntimeOptions): GetGrayDomainFunctionResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.functionNames)) {
    body['FunctionNames'] = request.functionNames;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetGrayDomainFunction',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 按域名、functionName查询灰度配置信息，返回的信息中包含当前的灰度状态、灰度进度
 *
 * @param request GetGrayDomainFunctionRequest
 * @return GetGrayDomainFunctionResponse
 */
async function getGrayDomainFunction(request: GetGrayDomainFunctionRequest): GetGrayDomainFunctionResponse {
  var runtime = new $RuntimeOptions{};
  return getGrayDomainFunctionWithOptions(request, runtime);
}

model ListDomainsByLogConfigIdRequest {
  configId?: string(name='ConfigId', description='The ID of the custom configuration.

This parameter is required.', example='123'),
}

model ListDomainsByLogConfigIdResponseBody = {
  domains?: {
    domain?: [ string ](name='Domain')
  }(name='Domains', description='The domain names.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9732E117-8A37-49FD-A36F-ABBB87556CA7'),
}

model ListDomainsByLogConfigIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDomainsByLogConfigIdResponseBody(name='body'),
}

/**
 * @summary Queries domain names by log configuration ID.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListDomainsByLogConfigIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDomainsByLogConfigIdResponse
 */
async function listDomainsByLogConfigIdWithOptions(request: ListDomainsByLogConfigIdRequest, runtime: $RuntimeOptions): ListDomainsByLogConfigIdResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDomainsByLogConfigId',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries domain names by log configuration ID.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListDomainsByLogConfigIdRequest
 * @return ListDomainsByLogConfigIdResponse
 */
async function listDomainsByLogConfigId(request: ListDomainsByLogConfigIdRequest): ListDomainsByLogConfigIdResponse {
  var runtime = new $RuntimeOptions{};
  return listDomainsByLogConfigIdWithOptions(request, runtime);
}

model ListFCTriggerRequest {
  eventMetaName?: string(name='EventMetaName', description='The name of the event. You can specify only one name.

This parameter is required.', example='LogFileCreated'),
  eventMetaVersion?: string(name='EventMetaVersion', description='The version number of the event. You can specify only one version number.

This parameter is required.', example='1.0.0'),
}

model ListFCTriggerResponseBody = {
  FCTriggers?: [ 
    {
      eventMetaName?: string(name='EventMetaName', description='The name of the event.', example='LogFileCreated'),
      eventMetaVersion?: string(name='EventMetaVersion', description='The version of the event.', example='1.0.0'),
      notes?: string(name='Notes', description='The remarks.', example='Test'),
      roleARN?: string(name='RoleARN', description='The Resource Access Management (RAM) role.', example='acs:ram:: 1234567890:role/aliyuncdneventnotificationrole'),
      sourceArn?: string(name='SourceArn', description='The resources and filters for event listening.', example='acs:cdn:*:1234567890:domain/example.com'),
      triggerARN?: string(name='TriggerARN', description='The trigger that corresponds to the Function Compute service.', example='acs:fc:cn-beijing: 1234567890:services/FCTestService/functions/printEvent/triggers/testtrigger'),
    }
  ](name='FCTriggers', description='The Function Compute triggers that are set for Alibaba Cloud CDN events.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EC046C5D-8CB4-4B6B-B7F8-B335E51EF90E'),
}

model ListFCTriggerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFCTriggerResponseBody(name='body'),
}

/**
 * @summary Queries the Function Compute trigger that is set for an Alibaba Cloud CDN event.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListFCTriggerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFCTriggerResponse
 */
async function listFCTriggerWithOptions(request: ListFCTriggerRequest, runtime: $RuntimeOptions): ListFCTriggerResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListFCTrigger',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the Function Compute trigger that is set for an Alibaba Cloud CDN event.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListFCTriggerRequest
 * @return ListFCTriggerResponse
 */
async function listFCTrigger(request: ListFCTriggerRequest): ListFCTriggerResponse {
  var runtime = new $RuntimeOptions{};
  return listFCTriggerWithOptions(request, runtime);
}

model ListRealtimeLogDeliveryResponseBody = {
  content?: {
    realtimeLogDeliveryInfo?: [ 
    {
      dmId?: int32(name='DmId', description='The domain ID.', example='1001010'),
      domain?: string(name='Domain', description='The accelerated domain name.', example='example.com'),
      logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.', example='test'),
      project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.', example='test'),
      region?: string(name='Region', description='The ID of the region where the Log Service project is deployed.', example='cn-hangzhou-corp'),
      status?: string(name='Status', description='The status of real-time log delivery.', example='online'),
    }
  ](name='RealtimeLogDeliveryInfo')
  }(name='Content', description='The logging information.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='30559C03-86C9-4EEC-B840-0DC5F5A2189B'),
}

model ListRealtimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRealtimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Queries all real-time log delivery tasks within your Alibaba Cloud account.
 *
 * @param request ListRealtimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRealtimeLogDeliveryResponse
 */
async function listRealtimeLogDeliveryWithOptions(runtime: $RuntimeOptions): ListRealtimeLogDeliveryResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListRealtimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all real-time log delivery tasks within your Alibaba Cloud account.
 *
 * @return ListRealtimeLogDeliveryResponse
 */
async function listRealtimeLogDelivery(): ListRealtimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return listRealtimeLogDeliveryWithOptions(runtime);
}

model ListRealtimeLogDeliveryDomainsRequest {
  logstore?: string(name='Logstore', description='The name of the Logstore that collects log data from Alibaba Cloud CDN in real time. You can specify multiple Logstore names and separate them with commas (,).

This parameter is required.', example='LogstoreName'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery. You can specify multiple project names and separate them with commas (,).

This parameter is required.', example='ProjectName'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed. You can specify multiple region IDs and separate them with commas (,).

For more information about regions, see [Regions that support real-time log delivery](https://help.aliyun.com/document_detail/144883.html).

This parameter is required.', example='ch-shanghai'),
}

model ListRealtimeLogDeliveryDomainsResponseBody = {
  content?: {
    domains?: [ 
    {
      domainName?: string(name='DomainName', description='The domain name.', example='example.com'),
      status?: string(name='Status', description='The status. Valid values:

*   **online**: enabled
*   **offline**: disabled', example='online'),
    }
  ](name='Domains')
  }(name='Content', description='The information about the accelerated domain names.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='95D5B69F-8AEC-419B-8F3A-612B35032B0D'),
}

model ListRealtimeLogDeliveryDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRealtimeLogDeliveryDomainsResponseBody(name='body'),
}

/**
 * @summary Queries all domain names that are associated with a specific real-time log delivery configuration record.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListRealtimeLogDeliveryDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRealtimeLogDeliveryDomainsResponse
 */
async function listRealtimeLogDeliveryDomainsWithOptions(request: ListRealtimeLogDeliveryDomainsRequest, runtime: $RuntimeOptions): ListRealtimeLogDeliveryDomainsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRealtimeLogDeliveryDomains',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all domain names that are associated with a specific real-time log delivery configuration record.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListRealtimeLogDeliveryDomainsRequest
 * @return ListRealtimeLogDeliveryDomainsResponse
 */
async function listRealtimeLogDeliveryDomains(request: ListRealtimeLogDeliveryDomainsRequest): ListRealtimeLogDeliveryDomainsResponse {
  var runtime = new $RuntimeOptions{};
  return listRealtimeLogDeliveryDomainsWithOptions(request, runtime);
}

model ListRealtimeLogDeliveryInfosResponseBody = {
  content?: {
    realtimeLogDeliveryInfos?: [ 
    {
      logstore?: string(name='Logstore', description='The name of the Logstore that collects log data from Alibaba Cloud CDN in real time.', example='LogstoreName'),
      project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.', example='ProjectName'),
      region?: string(name='Region', description='The ID of the region where the Log Service project is deployed. For more information, see [Regions that support real-time log delivery](https://help.aliyun.com/document_detail/144883.html).', example='ch-shanghai'),
    }
  ](name='RealtimeLogDeliveryInfos')
  }(name='Content', description='The information about real-time log delivery.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='95D5B69F-8AEC-419B-8F3A-612B35032B0D'),
}

model ListRealtimeLogDeliveryInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRealtimeLogDeliveryInfosResponseBody(name='body'),
}

/**
 * @summary Queries the information about the real-time log delivery feature in a specified region.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListRealtimeLogDeliveryInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRealtimeLogDeliveryInfosResponse
 */
async function listRealtimeLogDeliveryInfosWithOptions(runtime: $RuntimeOptions): ListRealtimeLogDeliveryInfosResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListRealtimeLogDeliveryInfos',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about the real-time log delivery feature in a specified region.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @return ListRealtimeLogDeliveryInfosResponse
 */
async function listRealtimeLogDeliveryInfos(): ListRealtimeLogDeliveryInfosResponse {
  var runtime = new $RuntimeOptions{};
  return listRealtimeLogDeliveryInfosWithOptions(runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='QpgBAAAAAABsb2dzL2RzLw=='),
  resourceId?: [ string ](name='ResourceId', description='The ID of the resource.'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to **DOMAIN**.

This parameter is required.', example='DOMAIN'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='testKey'),
      value?: string(name='Value', description='The value of the tag.', example='testValue'),
    }
  ](name='Tag', description='The key-value pair of a tag.'),
  tagOwnerBid?: string(name='TagOwnerBid', description='The business ID of the tag owner.', example='26842'),
  tagOwnerUid?: string(name='TagOwnerUid', description='The ID of the Alibaba Cloud account to which the tag belongs.', example='123xxxx'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='QpgBAAAAAABsb2dzL2RzLw=='),
  requestId?: string(name='RequestId', description='The request ID.', example='64D28B53-5902-409B-94F6-FD46680144FE'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='example.com'),
      resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to **DOMAIN**.', example='DOMAIN'),
      tagKey?: string(name='TagKey', description='The key of the tag.', example='testKey'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='testValue'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The returned correspondence between the resource and tags.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags that are attached to a resource.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.tagOwnerBid)) {
    query['TagOwnerBid'] = request.tagOwnerBid;
  }
  if (!$isNull(request.tagOwnerUid)) {
    query['TagOwnerUid'] = request.tagOwnerUid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the tags that are attached to a resource.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListUserCustomLogConfigResponseBody = {
  configIds?: {
    configId?: [ string ](name='ConfigId')
  }(name='ConfigIds', description='The list of log configuration IDs.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='95D5B69F-8AEC-419B-8F3A-612B35032B0D'),
}

model ListUserCustomLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserCustomLogConfigResponseBody(name='body'),
}

/**
 * @summary Queries all custom log configurations in your account.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ListUserCustomLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserCustomLogConfigResponse
 */
async function listUserCustomLogConfigWithOptions(runtime: $RuntimeOptions): ListUserCustomLogConfigResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListUserCustomLogConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all custom log configurations in your account.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @return ListUserCustomLogConfigResponse
 */
async function listUserCustomLogConfig(): ListUserCustomLogConfigResponse {
  var runtime = new $RuntimeOptions{};
  return listUserCustomLogConfigWithOptions(runtime);
}

model ModifyCdnDomainRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyuji4b6r4**'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The information about the addresses of origin servers.

> Do not set **Sources** and **TopLevelDomain** at the same time. If you set **Sources** and **TopLevelDomain** at the same time, **TopLevelDomain** does not take effect.', example='[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80,"weight":"15"}]'),
  topLevelDomain?: string(name='TopLevelDomain', description='The root domain. To add a root domain name, you must be added to the whitelist specified by the CDN_TOP_LEVEL_DOMAIN_GREY_USER_LIST parameter.

> Do not set **Sources** and **TopLevelDomain** at the same time. If you set **Sources** and **TopLevelDomain** at the same time, **TopLevelDomain** does not take effect.', example='aliyundoc.com'),
}

model ModifyCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model ModifyCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCdnDomainResponseBody(name='body'),
}

/**
 * @summary Modifies the configuration of an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request ModifyCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCdnDomainResponse
 */
async function modifyCdnDomainWithOptions(request: ModifyCdnDomainRequest, runtime: $RuntimeOptions): ModifyCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!$isNull(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configuration of an accelerated domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request ModifyCdnDomainRequest
 * @return ModifyCdnDomainResponse
 */
async function modifyCdnDomain(request: ModifyCdnDomainRequest): ModifyCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return modifyCdnDomainWithOptions(request, runtime);
}

model ModifyCdnDomainOwnerRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

This parameter is required.', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyCdnDomainOwnerResponseBody = {
  content?: map[string]any(name='Content', description='The description of the domain name transfer.', example='The domain does not allow to transfer to a different account.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C98E518B-024E-538E-8276-66310CB8667D'),
}

model ModifyCdnDomainOwnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCdnDomainOwnerResponseBody(name='body'),
}

/**
 * @summary Transfer domain names from an Alibaba Cloud account to the current account.
 *
 * @description This operation is used in the following scenario:
 * *   You have multiple Alibaba Cloud accounts and want to transfer domain names from Account A to Account B.
 * *   You are prompted that a domain name has been added when you add the domain name to Alibaba Cloud CDN. You do not know which account does the domain name belong to, and you want to transfer the domain name to your current account.
 *
 * @param request ModifyCdnDomainOwnerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCdnDomainOwnerResponse
 */
async function modifyCdnDomainOwnerWithOptions(request: ModifyCdnDomainOwnerRequest, runtime: $RuntimeOptions): ModifyCdnDomainOwnerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyCdnDomainOwner',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Transfer domain names from an Alibaba Cloud account to the current account.
 *
 * @description This operation is used in the following scenario:
 * *   You have multiple Alibaba Cloud accounts and want to transfer domain names from Account A to Account B.
 * *   You are prompted that a domain name has been added when you add the domain name to Alibaba Cloud CDN. You do not know which account does the domain name belong to, and you want to transfer the domain name to your current account.
 *
 * @param request ModifyCdnDomainOwnerRequest
 * @return ModifyCdnDomainOwnerResponse
 */
async function modifyCdnDomainOwner(request: ModifyCdnDomainOwnerRequest): ModifyCdnDomainOwnerResponse {
  var runtime = new $RuntimeOptions{};
  return modifyCdnDomainOwnerWithOptions(request, runtime);
}

model ModifyCdnDomainSchdmByPropertyRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name for which you want to change the acceleration region. You can specify only one domain name.

This parameter is required.', example='example.com'),
  property?: string(name='Property', description='The information about the acceleration region. {"coverage":"overseas"}

Valid values for coverage:

*   **domestic**: Chinese mainland
*   **overseas**: global (excluding the Chinese mainland)
*   **global**: global

This parameter is required.', example='{"coverage":"overseas"}'),
}

model ModifyCdnDomainSchdmByPropertyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-9187-2C4477247A74'),
}

model ModifyCdnDomainSchdmByPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCdnDomainSchdmByPropertyResponseBody(name='body'),
}

/**
 * @summary Changes the acceleration region for an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ModifyCdnDomainSchdmByPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCdnDomainSchdmByPropertyResponse
 */
async function modifyCdnDomainSchdmByPropertyWithOptions(request: ModifyCdnDomainSchdmByPropertyRequest, runtime: $RuntimeOptions): ModifyCdnDomainSchdmByPropertyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.property)) {
    query['Property'] = request.property;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyCdnDomainSchdmByProperty',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the acceleration region for an accelerated domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ModifyCdnDomainSchdmByPropertyRequest
 * @return ModifyCdnDomainSchdmByPropertyResponse
 */
async function modifyCdnDomainSchdmByProperty(request: ModifyCdnDomainSchdmByPropertyRequest): ModifyCdnDomainSchdmByPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return modifyCdnDomainSchdmByPropertyWithOptions(request, runtime);
}

model ModifyCdnServiceRequest {
  internetChargeType?: string(name='InternetChargeType', description='The new metering method for Alibaba Cloud CDN. Valid values:

*   **PayByTraffic**: pay-by-data-transfer
*   **PayByBandwidth**: pay-by-bandwidth

This parameter is required.', example='PayByTraffic'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyCdnServiceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model ModifyCdnServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCdnServiceResponseBody(name='body'),
}

/**
 * @summary Changes the metering method of Alibaba Cloud CDN.
 *
 * @param request ModifyCdnServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCdnServiceResponse
 */
async function modifyCdnServiceWithOptions(request: ModifyCdnServiceRequest, runtime: $RuntimeOptions): ModifyCdnServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.internetChargeType)) {
    query['InternetChargeType'] = request.internetChargeType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyCdnService',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the metering method of Alibaba Cloud CDN.
 *
 * @param request ModifyCdnServiceRequest
 * @return ModifyCdnServiceResponse
 */
async function modifyCdnService(request: ModifyCdnServiceRequest): ModifyCdnServiceResponse {
  var runtime = new $RuntimeOptions{};
  return modifyCdnServiceWithOptions(request, runtime);
}

model ModifyCustomDomainSampleRateRequest {
  baseConfigID?: string(name='BaseConfigID'),
  domainName?: string(name='DomainName', description='This parameter is required.'),
  sampleRate?: float(name='SampleRate', description='This parameter is required.'),
  sinkID?: long(name='SinkID'),
}

model ModifyCustomDomainSampleRateResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyCustomDomainSampleRateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyCustomDomainSampleRateResponseBody(name='body'),
}

/**
 * @summary A客户定制修改域名采样率接口
 *
 * @param request ModifyCustomDomainSampleRateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyCustomDomainSampleRateResponse
 */
async function modifyCustomDomainSampleRateWithOptions(request: ModifyCustomDomainSampleRateRequest, runtime: $RuntimeOptions): ModifyCustomDomainSampleRateResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.baseConfigID)) {
    body['BaseConfigID'] = request.baseConfigID;
  }
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.sampleRate)) {
    body['SampleRate'] = request.sampleRate;
  }
  if (!$isNull(request.sinkID)) {
    body['SinkID'] = request.sinkID;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyCustomDomainSampleRate',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary A客户定制修改域名采样率接口
 *
 * @param request ModifyCustomDomainSampleRateRequest
 * @return ModifyCustomDomainSampleRateResponse
 */
async function modifyCustomDomainSampleRate(request: ModifyCustomDomainSampleRateRequest): ModifyCustomDomainSampleRateResponse {
  var runtime = new $RuntimeOptions{};
  return modifyCustomDomainSampleRateWithOptions(request, runtime);
}

model ModifyRealtimeLogDeliveryRequest {
  domain?: string(name='Domain', description='The accelerated domain name for which you want to modify the configurations of real-time log delivery. Only one domain name is supported.

This parameter is required.', example='example.com'),
  logstore?: string(name='Logstore', description='The name of the Logstore where log entries are stored.

This parameter is required.', example='TestLog'),
  project?: string(name='Project', description='The name of the Log Service project that is used for real-time log delivery.

This parameter is required.', example='testProject'),
  region?: string(name='Region', description='The ID of the region where the Log Service project is deployed. For more information, see [Regions that support real-time log delivery](https://help.aliyun.com/document_detail/144883.html).

This parameter is required.', example='ch-shanghai'),
}

model ModifyRealtimeLogDeliveryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='9732E117-8A37-49FD-A36F-ABBB87556CA7'),
}

model ModifyRealtimeLogDeliveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyRealtimeLogDeliveryResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of real-time log delivery for a specific domain name. Each domain name supports only one Logstore.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ModifyRealtimeLogDeliveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyRealtimeLogDeliveryResponse
 */
async function modifyRealtimeLogDeliveryWithOptions(request: ModifyRealtimeLogDeliveryRequest, runtime: $RuntimeOptions): ModifyRealtimeLogDeliveryResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyRealtimeLogDelivery',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configurations of real-time log delivery for a specific domain name. Each domain name supports only one Logstore.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request ModifyRealtimeLogDeliveryRequest
 * @return ModifyRealtimeLogDeliveryResponse
 */
async function modifyRealtimeLogDelivery(request: ModifyRealtimeLogDeliveryRequest): ModifyRealtimeLogDeliveryResponse {
  var runtime = new $RuntimeOptions{};
  return modifyRealtimeLogDeliveryWithOptions(request, runtime);
}

model OpenCdnServiceRequest {
  internetChargeType?: string(name='InternetChargeType', description='The metering method of Alibaba Cloud CDN. A value of **PayByTraffic** indicates that the metering method is pay-by-data-transfer.

This parameter is required.', example='PayByTraffic'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model OpenCdnServiceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='97C68796-EB7F-4D41-9D5B-12B909D76508'),
}

model OpenCdnServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenCdnServiceResponseBody(name='body'),
}

/**
 * @summary Activates Alibaba Cloud CDN. You must activate Alibaba Cloud CDN before you can manage domain names in Alibaba Cloud CDN.
 *
 * @description *   Alibaba Cloud CDN can be activated only once per Alibaba Cloud account. The Alibaba Cloud account must complete real-name verification to activate Alibaba Cloud CDN.
 * *   You can call this operation up to five times per second per user.
 *
 * @param request OpenCdnServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenCdnServiceResponse
 */
async function openCdnServiceWithOptions(request: OpenCdnServiceRequest, runtime: $RuntimeOptions): OpenCdnServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.internetChargeType)) {
    query['InternetChargeType'] = request.internetChargeType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'OpenCdnService',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Activates Alibaba Cloud CDN. You must activate Alibaba Cloud CDN before you can manage domain names in Alibaba Cloud CDN.
 *
 * @description *   Alibaba Cloud CDN can be activated only once per Alibaba Cloud account. The Alibaba Cloud account must complete real-name verification to activate Alibaba Cloud CDN.
 * *   You can call this operation up to five times per second per user.
 *
 * @param request OpenCdnServiceRequest
 * @return OpenCdnServiceResponse
 */
async function openCdnService(request: OpenCdnServiceRequest): OpenCdnServiceResponse {
  var runtime = new $RuntimeOptions{};
  return openCdnServiceWithOptions(request, runtime);
}

model PublishGrayDomainConfigRequest {
  customCountryId?: int32(name='CustomCountryId'),
  customPercent?: int32(name='CustomPercent', example='15'),
  customProvinceId?: int32(name='CustomProvinceId'),
  domainName?: string(name='DomainName', description='This parameter is required.', example='example.com'),
  publishMode?: string(name='PublishMode', description='This parameter is required.', example='publishByCustom'),
}

model PublishGrayDomainConfigResponseBody = {
  requestId?: string(name='RequestId'),
}

model PublishGrayDomainConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishGrayDomainConfigResponseBody(name='body'),
}

/**
 * @summary 发布灰度配置到线上，支持多种模式，如全网发布、指定方式(灰度发布)，回滚
 *
 * @param request PublishGrayDomainConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PublishGrayDomainConfigResponse
 */
async function publishGrayDomainConfigWithOptions(request: PublishGrayDomainConfigRequest, runtime: $RuntimeOptions): PublishGrayDomainConfigResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.customCountryId)) {
    body['CustomCountryId'] = request.customCountryId;
  }
  if (!$isNull(request.customPercent)) {
    body['CustomPercent'] = request.customPercent;
  }
  if (!$isNull(request.customProvinceId)) {
    body['CustomProvinceId'] = request.customProvinceId;
  }
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.publishMode)) {
    body['PublishMode'] = request.publishMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'PublishGrayDomainConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 发布灰度配置到线上，支持多种模式，如全网发布、指定方式(灰度发布)，回滚
 *
 * @param request PublishGrayDomainConfigRequest
 * @return PublishGrayDomainConfigResponse
 */
async function publishGrayDomainConfig(request: PublishGrayDomainConfigRequest): PublishGrayDomainConfigResponse {
  var runtime = new $RuntimeOptions{};
  return publishGrayDomainConfigWithOptions(request, runtime);
}

model PublishStagingConfigToProductionRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each call.

This parameter is required.', example='example.com'),
}

model PublishStagingConfigToProductionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model PublishStagingConfigToProductionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishStagingConfigToProductionResponseBody(name='body'),
}

/**
 * @summary Publishes the configurations of the staging environment to the production environment.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request PublishStagingConfigToProductionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PublishStagingConfigToProductionResponse
 */
async function publishStagingConfigToProductionWithOptions(request: PublishStagingConfigToProductionRequest, runtime: $RuntimeOptions): PublishStagingConfigToProductionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PublishStagingConfigToProduction',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Publishes the configurations of the staging environment to the production environment.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request PublishStagingConfigToProductionRequest
 * @return PublishStagingConfigToProductionResponse
 */
async function publishStagingConfigToProduction(request: PublishStagingConfigToProductionRequest): PublishStagingConfigToProductionResponse {
  var runtime = new $RuntimeOptions{};
  return publishStagingConfigToProductionWithOptions(request, runtime);
}

model PushObjectCacheRequest {
  area?: string(name='Area', description='The acceleration region where content is to be prefetched. Valid values:

*   **domestic****: Chinese mainland**
*   **overseas****: regions outside the Chinese mainland**

If you do not set this parameter, content in the service location (specified by parameter Coverage) that you configured for the domain is prefetched. Content is prefetched based on the following rules:

*   If the acceleration region is set to **Chinese Mainland Only**, content in regions in the Chinese mainland is prefetched.
*   If the acceleration region is set to **Global**, content in all regions is prefetched.
*   If the acceleration region is set to **Global (Excluding the Chinese Mainland)**, content in regions outside the Chinese mainland is prefetched.', example='domestic'),
  l2Preload?: boolean(name='L2Preload', description='Specifies whether to prefetch content to L2 points of presence (POPs). Valid values:

*   **true**: prefetches content to L2 POPs.
*   **false**: prefetches content to regular POPs. Regular POPs can be L2 POPs or L3 POPs. Default value: **false**.', example='true'),
  objectPath?: string(name='ObjectPath', description='The URLs based on which content is prefetched. Format: **accelerated domain name/files to be prefetched**.

> Separate URLs with line feeds (\\\\n or \\\\r\\\\n). Each object path can be up to 1,024 characters in length.

This parameter is required.', example='example.com/image/1.png\\\\nexample.org/image/2.png'),
  ownerId?: long(name='OwnerId'),
  queryHashkey?: boolean(name='QueryHashkey', description='This parameter specifies whether to enable the hash key query mode when you run a prefetch task. Valid values:

*   false: The default mode, in which the submitted URL is used as the hash key for the prefetch.
*   true: In this mode, the actual hash key used for the prefetch is queried based on the configuration of the domain name.', example='true'),
  securityToken?: string(name='SecurityToken'),
  withHeader?: string(name='WithHeader', description='The custom header for prefetch in the JSON format.', example='{
      "Accept-Encoding": [
            "gzip"
      ]
}'),
}

model PushObjectCacheResponseBody = {
  pushTaskId?: string(name='PushTaskId', description='The ID of the prefetch task. If multiple tasks are returned, the IDs are separated by commas (,). The task IDs are merged based on the following rules:

*   If the tasks are set for the same accelerated domain name, submitted within the same second, and prefetch content from URLs instead of directories, the tasks IDs are merged into the same task ID (RushTaskId).
*   If the number of tasks that are set for the same accelerated domain name, submitted within the same second, and prefetch content from URLs instead of directories exceeds 500, every 500 task IDs are merged into the same task ID (RushTaskId).', example='9524xxxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model PushObjectCacheResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushObjectCacheResponseBody(name='body'),
}

/**
 * @summary Prefetches content from origin servers to points of presence (POPs). This reduces loads on origin servers because users can directly hit cache upon their first visits.
 *
 * @description *   Alibaba Cloud CDN supports POST requests in which parameters are sent as a form.
 * *   You can call the [RefreshObjectCaches](https://help.aliyun.com/document_detail/91164.html) operation to refresh content and call the [PushObjectCache](https://help.aliyun.com/document_detail/91161.html) operation to prefetch content.
 * *   By default, each Alibaba Cloud account can submit up to 1,000 URLs per day. If the daily peak bandwidth value of your workloads exceeds 200 Mbit/s, you can [submit a ticket](https://account.alibabacloud.com/login/login.htm?oauth_callback=https%3A//ticket-intl.console.aliyun.com/%23/ticket/createIndex) to increase your daily quota. Alibaba Cloud reviews your application and then increases the quota accordingly.
 * *   You can specify at most 100 URLs in each prefetch request.
 * *   For each Alibaba Cloud account, the prefetch queue can contain up to 50,000 URLs. Content is prefetched based on the time when the URLs are submitted. The URL that is submitted the earliest has the highest priority. If the number of URLs in the queue reaches 50,000, you cannot submit more URLs until the number drops below 50,000.
 * *   You can call this operation up to 50 times per second per account.
 * *   For more information about how to automate refresh or prefetch tasks, see [Run scripts to refresh and prefetch content](https://help.aliyun.com/document_detail/151829.html).
 * ## Precautions
 * *   After a prefetch task is submitted and completed, the POPs immediately start to retrieve resources from the origin server. Therefore, a large number of refresh tasks cause a large number of concurrent download tasks. This increases the number of requests that are redirected to the origin server. The back-to-origin routing process consumes more bandwidth resources and the origin server may be overwhelmed.
 * *   The time required for a prefetch task to complete is proportional to the size of the prefetched file. In actual practice, most prefetch tasks require 5 to 30 minutes to complete. A task with a smaller average file size requires less time.
 * *   To allow RAM users to perform this operation, you must first grant them the required permissions. For more information, see [Authorize a RAM user to prefetch and refresh resources](https://help.aliyun.com/document_detail/260300.html).
 *
 * @param request PushObjectCacheRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushObjectCacheResponse
 */
async function pushObjectCacheWithOptions(request: PushObjectCacheRequest, runtime: $RuntimeOptions): PushObjectCacheResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.area)) {
    query['Area'] = request.area;
  }
  if (!$isNull(request.l2Preload)) {
    query['L2Preload'] = request.l2Preload;
  }
  if (!$isNull(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.queryHashkey)) {
    query['QueryHashkey'] = request.queryHashkey;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.withHeader)) {
    query['WithHeader'] = request.withHeader;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PushObjectCache',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Prefetches content from origin servers to points of presence (POPs). This reduces loads on origin servers because users can directly hit cache upon their first visits.
 *
 * @description *   Alibaba Cloud CDN supports POST requests in which parameters are sent as a form.
 * *   You can call the [RefreshObjectCaches](https://help.aliyun.com/document_detail/91164.html) operation to refresh content and call the [PushObjectCache](https://help.aliyun.com/document_detail/91161.html) operation to prefetch content.
 * *   By default, each Alibaba Cloud account can submit up to 1,000 URLs per day. If the daily peak bandwidth value of your workloads exceeds 200 Mbit/s, you can [submit a ticket](https://account.alibabacloud.com/login/login.htm?oauth_callback=https%3A//ticket-intl.console.aliyun.com/%23/ticket/createIndex) to increase your daily quota. Alibaba Cloud reviews your application and then increases the quota accordingly.
 * *   You can specify at most 100 URLs in each prefetch request.
 * *   For each Alibaba Cloud account, the prefetch queue can contain up to 50,000 URLs. Content is prefetched based on the time when the URLs are submitted. The URL that is submitted the earliest has the highest priority. If the number of URLs in the queue reaches 50,000, you cannot submit more URLs until the number drops below 50,000.
 * *   You can call this operation up to 50 times per second per account.
 * *   For more information about how to automate refresh or prefetch tasks, see [Run scripts to refresh and prefetch content](https://help.aliyun.com/document_detail/151829.html).
 * ## Precautions
 * *   After a prefetch task is submitted and completed, the POPs immediately start to retrieve resources from the origin server. Therefore, a large number of refresh tasks cause a large number of concurrent download tasks. This increases the number of requests that are redirected to the origin server. The back-to-origin routing process consumes more bandwidth resources and the origin server may be overwhelmed.
 * *   The time required for a prefetch task to complete is proportional to the size of the prefetched file. In actual practice, most prefetch tasks require 5 to 30 minutes to complete. A task with a smaller average file size requires less time.
 * *   To allow RAM users to perform this operation, you must first grant them the required permissions. For more information, see [Authorize a RAM user to prefetch and refresh resources](https://help.aliyun.com/document_detail/260300.html).
 *
 * @param request PushObjectCacheRequest
 * @return PushObjectCacheResponse
 */
async function pushObjectCache(request: PushObjectCacheRequest): PushObjectCacheResponse {
  var runtime = new $RuntimeOptions{};
  return pushObjectCacheWithOptions(request, runtime);
}

model RefreshObjectCacheByCacheTagRequest {
  cacheTag?: string(name='CacheTag', description='The tags of Cache. If multiple tags are returned, the tags are separated by commas (,).

This parameter is required.', example='tag1,tag2'),
  domainName?: string(name='DomainName', description='The accelerated domain name.

This parameter is required.', example='example.com'),
  force?: boolean(name='Force', description='Specifies whether to purge all resources that you submit if the requested content is one of the resources that you submit to purge. Default value: false.

*   **true**: The nearest POP fetches all resources from the origin server, delivers them to the client, and updates the cache with the new version.
*   **false**: The nearest POP checks the Last-Modified parameter of the resource on the origin server. If the parameter value is the same as that of the cached resource, the POP serves the cached resource. If the parameter value is not the same as that of the cached resource, the POP fetches the latest version from the origin server, delivers it to the client, and updates the cache with the new version.', example='true'),
}

model RefreshObjectCacheByCacheTagResponseBody = {
  refreshTaskId?: string(name='RefreshTaskId', description='The ID of the refresh task. If multiple tasks are returned, the task IDs are separated by commas (,). The task IDs are merged based on the following rules:

*   If the tasks are specified for the same accelerated domain name, submitted within the same second, and run to refresh content based on URLs instead of directories, the task IDs are merged into one task ID (RefreshTaskId).
*   If the number of tasks that are specified for the same accelerated domain name, submitted within the same second, and run to refresh content based on URLs instead of directories exceeds 2,000, every 2,000 task IDs are merged into one task ID (RefreshTaskId).', example='17772470184'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2E5AD83F-BD7B-462E-8319-2E30E305519A'),
}

model RefreshObjectCacheByCacheTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshObjectCacheByCacheTagResponseBody(name='body'),
}

/**
 * @summary Refreshes the cache based on cache tags that you configured.
 *
 * @param request RefreshObjectCacheByCacheTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshObjectCacheByCacheTagResponse
 */
async function refreshObjectCacheByCacheTagWithOptions(request: RefreshObjectCacheByCacheTagRequest, runtime: $RuntimeOptions): RefreshObjectCacheByCacheTagResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cacheTag)) {
    query['CacheTag'] = request.cacheTag;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshObjectCacheByCacheTag',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Refreshes the cache based on cache tags that you configured.
 *
 * @param request RefreshObjectCacheByCacheTagRequest
 * @return RefreshObjectCacheByCacheTagResponse
 */
async function refreshObjectCacheByCacheTag(request: RefreshObjectCacheByCacheTagRequest): RefreshObjectCacheByCacheTagResponse {
  var runtime = new $RuntimeOptions{};
  return refreshObjectCacheByCacheTagWithOptions(request, runtime);
}

model RefreshObjectCachesRequest {
  force?: boolean(name='Force'),
  objectPath?: string(name='ObjectPath', description='This parameter is required.'),
  objectType?: string(name='ObjectType'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model RefreshObjectCachesResponseBody = {
  refreshTaskId?: string(name='RefreshTaskId', description='The ID of the refresh task. If multiple tasks are returned, the task IDs are separated by commas (,). The task IDs are merged based on the following rules:

*   If the tasks are specified for the same accelerated domain name, submitted within the same second, and run to refresh content based on URLs instead of directories, the task IDs are merged into one task ID (RefreshTaskId).
*   If the number of tasks that are specified for the same accelerated domain name, submitted within the same second, and run to refresh content based on URLs instead of directories exceeds 2,000, every 2,000 task IDs are merged into one task ID (RefreshTaskId).', example='704222904'),
  requestId?: string(name='RequestId', description='The request ID.', example='D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C'),
}

model RefreshObjectCachesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshObjectCachesResponseBody(name='body'),
}

/**
 * @summary Refreshes files on Alibaba Cloud CDN points of presence (POPs). After files are refreshed, the original file content immediately becomes invalid. If clients request the original file content, Alibaba Cloud CDN forwards the requests to the origin server. Then, Alibaba Cloud CDN caches the latest content to the POPs and returns the content to the clients. Alibaba Cloud CDN allows you to refresh content from multiple URLs at the same time.
 *
 * @description *   Alibaba Cloud CDN supports POST requests in which parameters are sent as a form.
 * *   You can call the [RefreshObjectCaches](https://help.aliyun.com/document_detail/91164.html) operation to refresh content and call the [PushObjectCache](https://help.aliyun.com/document_detail/91161.html) operation to prefetch content.
 * *   You can call the RefreshObjectCaches operation up to 50 times per second per account.
 * *   For more information about how to automatically refresh or prefetch tasks, see [Run scripts to refresh and prefetch content](https://help.aliyun.com/document_detail/151829.html).
 * ## Precautions
 * *   After a refresh task is submitted and completed, specific resources are removed from POPs. When a POP receives a request for the removed resources, the POP forwards the request to the origin server to retrieve the resources. The retrieved resources are returned to the client and cached on the POP. Multiple refresh tasks may cause a large number of resources to be removed from the POPs. This increases the number of requests that are forwarded to the origin server. The back-to-origin routing process consumes more bandwidth resources and the origin server may be overwhelmed.
 * *   A refresh task takes effect 5 to 6 minutes after being submitted. This means that if the resource you want to refresh has a TTL of less than five minutes, you wait for it to expire instead of manually running a refresh task.
 * *   If you want to use RAM users to refresh or prefetch resources, you must obtain the required permissions. For more information, see [Authorize a RAM user to prefetch and refresh resources](https://help.aliyun.com/document_detail/260300.html).
 * ### Refresh quota
 * *   By default, each Alibaba Cloud account can refresh content from up to 10,000 URLs and 100 directories per day. The directories include subdirectories. If the daily peak bandwidth value exceeds 200 Mbit/s, you can [submit a ticket](https://account.alibabacloud.com/login/login.htm?oauth_callback=https%3A//ticket-intl.console.aliyun.com/%23/ticket/createIndex) to request a quota increase. Alibaba Cloud CDN evaluates your application based on your workloads.
 * *   By default, each Alibaba Cloud account can submit up to 20 refresh rules that contain regular expressions per day. If the daily peak bandwidth of your Alibaba Cloud account exceeds 10 Gbit/s, you can [submit a ticket](https://workorder-intl.console.aliyun.com/#/ticket/createIndex) to request a quota increase.
 * *   You can specify up to 1,000 URL refresh rules, 100 directory refresh rules, or 1 refresh rule that contains regular expressions in each call.
 * *   You can refresh up to 1,000 URLs per minute for each domain name.
 *
 * @param request RefreshObjectCachesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshObjectCachesResponse
 */
async function refreshObjectCachesWithOptions(request: RefreshObjectCachesRequest, runtime: $RuntimeOptions): RefreshObjectCachesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var body : map[string]any = {};
  if (!$isNull(request.force)) {
    body['Force'] = request.force;
  }
  if (!$isNull(request.objectPath)) {
    body['ObjectPath'] = request.objectPath;
  }
  if (!$isNull(request.objectType)) {
    body['ObjectType'] = request.objectType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshObjectCaches',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Refreshes files on Alibaba Cloud CDN points of presence (POPs). After files are refreshed, the original file content immediately becomes invalid. If clients request the original file content, Alibaba Cloud CDN forwards the requests to the origin server. Then, Alibaba Cloud CDN caches the latest content to the POPs and returns the content to the clients. Alibaba Cloud CDN allows you to refresh content from multiple URLs at the same time.
 *
 * @description *   Alibaba Cloud CDN supports POST requests in which parameters are sent as a form.
 * *   You can call the [RefreshObjectCaches](https://help.aliyun.com/document_detail/91164.html) operation to refresh content and call the [PushObjectCache](https://help.aliyun.com/document_detail/91161.html) operation to prefetch content.
 * *   You can call the RefreshObjectCaches operation up to 50 times per second per account.
 * *   For more information about how to automatically refresh or prefetch tasks, see [Run scripts to refresh and prefetch content](https://help.aliyun.com/document_detail/151829.html).
 * ## Precautions
 * *   After a refresh task is submitted and completed, specific resources are removed from POPs. When a POP receives a request for the removed resources, the POP forwards the request to the origin server to retrieve the resources. The retrieved resources are returned to the client and cached on the POP. Multiple refresh tasks may cause a large number of resources to be removed from the POPs. This increases the number of requests that are forwarded to the origin server. The back-to-origin routing process consumes more bandwidth resources and the origin server may be overwhelmed.
 * *   A refresh task takes effect 5 to 6 minutes after being submitted. This means that if the resource you want to refresh has a TTL of less than five minutes, you wait for it to expire instead of manually running a refresh task.
 * *   If you want to use RAM users to refresh or prefetch resources, you must obtain the required permissions. For more information, see [Authorize a RAM user to prefetch and refresh resources](https://help.aliyun.com/document_detail/260300.html).
 * ### Refresh quota
 * *   By default, each Alibaba Cloud account can refresh content from up to 10,000 URLs and 100 directories per day. The directories include subdirectories. If the daily peak bandwidth value exceeds 200 Mbit/s, you can [submit a ticket](https://account.alibabacloud.com/login/login.htm?oauth_callback=https%3A//ticket-intl.console.aliyun.com/%23/ticket/createIndex) to request a quota increase. Alibaba Cloud CDN evaluates your application based on your workloads.
 * *   By default, each Alibaba Cloud account can submit up to 20 refresh rules that contain regular expressions per day. If the daily peak bandwidth of your Alibaba Cloud account exceeds 10 Gbit/s, you can [submit a ticket](https://workorder-intl.console.aliyun.com/#/ticket/createIndex) to request a quota increase.
 * *   You can specify up to 1,000 URL refresh rules, 100 directory refresh rules, or 1 refresh rule that contains regular expressions in each call.
 * *   You can refresh up to 1,000 URLs per minute for each domain name.
 *
 * @param request RefreshObjectCachesRequest
 * @return RefreshObjectCachesResponse
 */
async function refreshObjectCaches(request: RefreshObjectCachesRequest): RefreshObjectCachesResponse {
  var runtime = new $RuntimeOptions{};
  return refreshObjectCachesWithOptions(request, runtime);
}

model RollbackStagingConfigRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
}

model RollbackStagingConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model RollbackStagingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RollbackStagingConfigResponseBody(name='body'),
}

/**
 * @summary Rolls back configurations in the staging environment. After you call this operation, all configurations in the staging environment are cleared.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request RollbackStagingConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RollbackStagingConfigResponse
 */
async function rollbackStagingConfigWithOptions(request: RollbackStagingConfigRequest, runtime: $RuntimeOptions): RollbackStagingConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RollbackStagingConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Rolls back configurations in the staging environment. After you call this operation, all configurations in the staging environment are cleared.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request RollbackStagingConfigRequest
 * @return RollbackStagingConfigResponse
 */
async function rollbackStagingConfig(request: RollbackStagingConfigRequest): RollbackStagingConfigResponse {
  var runtime = new $RuntimeOptions{};
  return rollbackStagingConfigWithOptions(request, runtime);
}

model SetCdnDomainCSRCertificateRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name for which you want to configure an SSL certificate. The domain name must have HTTPS secure acceleration enabled.

This parameter is required.', example='example.com'),
  serverCertificate?: string(name='ServerCertificate', description='The content of the certificate. The certificate must match the certificate signing request (CSR) created by calling the [CreateCdnCertificateSigningRequest](https://help.aliyun.com/document_detail/144478.html) operation. Make sure that the content of the certificate is encoded in Base64 and then encoded by encodeURIComponent.

This parameter is required.', example='----BEGIN CERTIFICATE----- MIIFz****-----END CERTIFICATE-----'),
}

model SetCdnDomainCSRCertificateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C9'),
}

model SetCdnDomainCSRCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCdnDomainCSRCertificateResponseBody(name='body'),
}

/**
 * @summary You can call this operation to configure an SSL certificate for a specific domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request SetCdnDomainCSRCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCdnDomainCSRCertificateResponse
 */
async function setCdnDomainCSRCertificateWithOptions(request: SetCdnDomainCSRCertificateRequest, runtime: $RuntimeOptions): SetCdnDomainCSRCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.serverCertificate)) {
    query['ServerCertificate'] = request.serverCertificate;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetCdnDomainCSRCertificate',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to configure an SSL certificate for a specific domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request SetCdnDomainCSRCertificateRequest
 * @return SetCdnDomainCSRCertificateResponse
 */
async function setCdnDomainCSRCertificate(request: SetCdnDomainCSRCertificateRequest): SetCdnDomainCSRCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return setCdnDomainCSRCertificateWithOptions(request, runtime);
}

model SetCdnDomainSMCertificateRequest {
  certIdentifier?: string(name='CertIdentifier', description='The ID of the SM certificate that you want to configure. The identifier of the certificate. The value is Certificate ID-cn-hangzhou. For example, if the certificate ID is 123, set the value of this parameter to 123-cn-hangzhou.

This parameter is required.', example='1234****-cn-hangzhou'),
  domainName?: string(name='DomainName', description='The accelerated domain name for which you want to configure the SM certificate.

> The domain name must use HTTPS acceleration.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  SSLProtocol?: string(name='SSLProtocol', description='Specifies whether to enable the SSL certificate. Valid values:

*   **on**
*   **off**

This parameter is required.', example='on'),
  securityToken?: string(name='SecurityToken'),
}

model SetCdnDomainSMCertificateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0AEDAF20-4DDF-4165-8750-47FF9C1929C8'),
}

model SetCdnDomainSMCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCdnDomainSMCertificateResponseBody(name='body'),
}

/**
 * @summary Enables or disables a ShangMi (SM) certificate for a domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request SetCdnDomainSMCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCdnDomainSMCertificateResponse
 */
async function setCdnDomainSMCertificateWithOptions(request: SetCdnDomainSMCertificateRequest, runtime: $RuntimeOptions): SetCdnDomainSMCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certIdentifier)) {
    query['CertIdentifier'] = request.certIdentifier;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.SSLProtocol)) {
    query['SSLProtocol'] = request.SSLProtocol;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetCdnDomainSMCertificate',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables a ShangMi (SM) certificate for a domain name.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request SetCdnDomainSMCertificateRequest
 * @return SetCdnDomainSMCertificateResponse
 */
async function setCdnDomainSMCertificate(request: SetCdnDomainSMCertificateRequest): SetCdnDomainSMCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return setCdnDomainSMCertificateWithOptions(request, runtime);
}

model SetCdnDomainSSLCertificateRequest {
  certId?: long(name='CertId', description='The ID of the certificate.', example='8089870'),
  certName?: string(name='CertName', description='The name of the SSL certificate. You can specify only one certificate name.', example='yourCertName'),
  certRegion?: string(name='CertRegion', description='The region ID of the certificate. Valid values: **cn-hangzhou** and **ap-southeast-1**. Default value: **cn-hangzhou**.', example='cn-hangzhou'),
  certType?: string(name='CertType', description='The type of the certificate.

*   **upload**: a user-uploaded SSL certificate.
*   **cas**: a certificate that is acquired through Certificate Management Service.', example='upload'),
  domainName?: string(name='DomainName', description='The accelerated domain name for which you want to configure the SSL certificate. The type of request supported by the domain name must be HTTPS. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  env?: string(name='Env', description='Specifies whether the certificate is issued in canary releases. If you set this parameter to **staging**, the certificate is issued in canary releases. If you do not specify this parameter or set this parameter to other values, the certificate is officially issued.', example='staging'),
  ownerId?: long(name='OwnerId'),
  SSLPri?: string(name='SSLPri', description='The private key. Specify the private key only if you want to enable the SSL certificate.', example='y****'),
  SSLProtocol?: string(name='SSLProtocol', description='Specifies whether to enable the SSL certificate.

*   **on**
*   **off**

This parameter is required.', example='off'),
  SSLPub?: string(name='SSLPub', description='The content of the SSL certificate. Specify the content of the SSL certificate only if you want to enable the SSL certificate.', example='xxx'),
  securityToken?: string(name='SecurityToken'),
}

model SetCdnDomainSSLCertificateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A7C69682-7F88-40DD-A198-10D0309E439D'),
}

model SetCdnDomainSSLCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCdnDomainSSLCertificateResponseBody(name='body'),
}

/**
 * @summary Enables or disables the certificate for a domain name and updates the certificate information.
 *
 * @description *   You can call this operation up to 30 times per second per account.
 * *   Method: POST.
 *
 * @param request SetCdnDomainSSLCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCdnDomainSSLCertificateResponse
 */
async function setCdnDomainSSLCertificateWithOptions(request: SetCdnDomainSSLCertificateRequest, runtime: $RuntimeOptions): SetCdnDomainSSLCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  if (!$isNull(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!$isNull(request.certRegion)) {
    query['CertRegion'] = request.certRegion;
  }
  if (!$isNull(request.certType)) {
    query['CertType'] = request.certType;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.env)) {
    query['Env'] = request.env;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.SSLPri)) {
    query['SSLPri'] = request.SSLPri;
  }
  if (!$isNull(request.SSLProtocol)) {
    query['SSLProtocol'] = request.SSLProtocol;
  }
  if (!$isNull(request.SSLPub)) {
    query['SSLPub'] = request.SSLPub;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetCdnDomainSSLCertificate',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables the certificate for a domain name and updates the certificate information.
 *
 * @description *   You can call this operation up to 30 times per second per account.
 * *   Method: POST.
 *
 * @param request SetCdnDomainSSLCertificateRequest
 * @return SetCdnDomainSSLCertificateResponse
 */
async function setCdnDomainSSLCertificate(request: SetCdnDomainSSLCertificateRequest): SetCdnDomainSSLCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return setCdnDomainSSLCertificateWithOptions(request, runtime);
}

model SetCdnDomainStagingConfigRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  functions?: string(name='Functions', description='The features that you want to configure. Format:

> *   **functionName**: The name of the feature. Separate multiple values with commas (,). For more information, see [A list of features](https://help.aliyun.com/document_detail/388460.html).
>*   **argName**: The feature parameters for **functionName**.
>*   **argValue**: The parameter values set for **functionName**.

        [
         {
           "functionArgs": [
            {
             "argName": "Parameter A", 
             "argValue": "Value of Parameter A"
            }, 
          {
            "argName": "Parameter B", 
            "argValue": "Value of Parameter B"
             }
         ], 
         "functionName": "Feature name"
            }
        ]

This parameter is required.', example='[{"functionArgs":[{"argName":"enable","argValue":"on"},{"argName":"pri","argValue":"1"},{"argName":"rule","argValue":"xxx"}],"functionName":"edge_function"}]'),
}

model SetCdnDomainStagingConfigResponseBody = {
  domainConfigList?: [ 
    {
      configId?: long(name='ConfigId', description='The ID of the configuration.', example='1234567'),
      domainName?: string(name='DomainName', description='The domain name.', example='www.example.com'),
      functionName?: string(name='FunctionName', description='The name of the feature.', example='set_resp_header'),
    }
  ](name='DomainConfigList', description='The list of domain configurations.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model SetCdnDomainStagingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCdnDomainStagingConfigResponseBody(name='body'),
}

/**
 * @summary Configures a domain name to be accelerated in the staging environment.
 *
 * @description >  You can call this operation up to 30 times per second per account.
 *
 * @param request SetCdnDomainStagingConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCdnDomainStagingConfigResponse
 */
async function setCdnDomainStagingConfigWithOptions(request: SetCdnDomainStagingConfigRequest, runtime: $RuntimeOptions): SetCdnDomainStagingConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.functions)) {
    query['Functions'] = request.functions;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetCdnDomainStagingConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Configures a domain name to be accelerated in the staging environment.
 *
 * @description >  You can call this operation up to 30 times per second per account.
 *
 * @param request SetCdnDomainStagingConfigRequest
 * @return SetCdnDomainStagingConfigResponse
 */
async function setCdnDomainStagingConfig(request: SetCdnDomainStagingConfigRequest): SetCdnDomainStagingConfigResponse {
  var runtime = new $RuntimeOptions{};
  return setCdnDomainStagingConfigWithOptions(request, runtime);
}

model SetCdnFullDomainsBlockIPRequest {
  blockInterval?: int32(name='BlockInterval', description='The duration for which IP addresses or CIDR blocks are blocked. Unit: seconds. The value **0** specifies that IP addresses or CIDR blocks are permanently blocked. This parameter is available only if you set **OperationType** to **block**.', example='3000'),
  IPList?: string(name='IPList', description='The IP addresses that you want to block or unblock. Separate multiple IP addresses with commas (,). You can specify up to 1,000 IP addresses.

This parameter is required.', example='1.XXX.XXX.1,2.XXX.XXX.2'),
  operationType?: string(name='OperationType', description='The type of the operation.

*   block
*   unblock

This parameter is required.', example='block'),
  updateType?: string(name='UpdateType', description='The type of the blocking duration. This parameter is available only if you set **OperationType** to **block**. Valid values:

*   **cover**: The blocking duration that is specified in the request takes effect.
*   **uncover**: The longer one of the blocking duration that is specified in the request and the remaining blocking duration takes effect.
*   Default value: cover.', example='cover'),
}

model SetCdnFullDomainsBlockIPResponseBody = {
  code?: int32(name='Code', description='The status code. The status code 0 indicates that the call is successful. If another status code is returned, the call fails.', example='0'),
  message?: string(name='Message', description='The additional information returned. If the request was successful, OK is returned. If the request failed, an error message is returned.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='23ACE7E2-2302-42E3-98F8-E5E697FD86C3'),
}

model SetCdnFullDomainsBlockIPResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCdnFullDomainsBlockIPResponseBody(name='body'),
}

/**
 * @summary Blocks or unblocks IP addresses from accessing domain names.
 *
 * @description > 
 * *   To use this operation, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).
 * *   This operation is suitable for blocking or unblocking a maximum of 1,000 IP addresses or CIDR blocks at a time.
 *
 * @param request SetCdnFullDomainsBlockIPRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCdnFullDomainsBlockIPResponse
 */
async function setCdnFullDomainsBlockIPWithOptions(request: SetCdnFullDomainsBlockIPRequest, runtime: $RuntimeOptions): SetCdnFullDomainsBlockIPResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.blockInterval)) {
    body['BlockInterval'] = request.blockInterval;
  }
  if (!$isNull(request.IPList)) {
    body['IPList'] = request.IPList;
  }
  if (!$isNull(request.operationType)) {
    body['OperationType'] = request.operationType;
  }
  if (!$isNull(request.updateType)) {
    body['UpdateType'] = request.updateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetCdnFullDomainsBlockIP',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Blocks or unblocks IP addresses from accessing domain names.
 *
 * @description > 
 * *   To use this operation, [submit a ticket](https://workorder-intl.console.aliyun.com/?spm=5176.2020520001.aliyun_topbar.18.dbd44bd3e4f845#/ticket/createIndex).
 * *   This operation is suitable for blocking or unblocking a maximum of 1,000 IP addresses or CIDR blocks at a time.
 *
 * @param request SetCdnFullDomainsBlockIPRequest
 * @return SetCdnFullDomainsBlockIPResponse
 */
async function setCdnFullDomainsBlockIP(request: SetCdnFullDomainsBlockIPRequest): SetCdnFullDomainsBlockIPResponse {
  var runtime = new $RuntimeOptions{};
  return setCdnFullDomainsBlockIPWithOptions(request, runtime);
}

model SetReqHeaderConfigRequest {
  configId?: long(name='ConfigId', description='The ID of the configuration.', example='123'),
  domainName?: string(name='DomainName', description='The accelerated domain name. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  key?: string(name='Key', description='The name of the custom header.

This parameter is required.', example='testkey'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
  value?: string(name='Value', description='The value of the custom header.

This parameter is required.', example='testvalue'),
}

model SetReqHeaderConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model SetReqHeaderConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetReqHeaderConfigResponseBody(name='body'),
}

/**
 * @summary Sets a custom origin header.
 *
 * @param request SetReqHeaderConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetReqHeaderConfigResponse
 */
async function setReqHeaderConfigWithOptions(request: SetReqHeaderConfigRequest, runtime: $RuntimeOptions): SetReqHeaderConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetReqHeaderConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Sets a custom origin header.
 *
 * @param request SetReqHeaderConfigRequest
 * @return SetReqHeaderConfigResponse
 */
async function setReqHeaderConfig(request: SetReqHeaderConfigRequest): SetReqHeaderConfigResponse {
  var runtime = new $RuntimeOptions{};
  return setReqHeaderConfigWithOptions(request, runtime);
}

model SetWaitingRoomConfigRequest {
  allowPct?: int32(name='AllowPct', description='The percentage of requests that are allowed to be redirected to the origin server. Valid values: **0** to **100**.

This parameter is required.', example='30'),
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name.

This parameter is required.', example='example.com'),
  gapTime?: int32(name='GapTime', description='The length of waiting time to skip after an exit from the queue. Unit: seconds.

This parameter is required.', example='20'),
  maxTimeWait?: int32(name='MaxTimeWait', description='The maximum length of waiting time in the queue. Unit: seconds.

This parameter is required.', example='30'),
  waitUri?: string(name='WaitUri', description='The regular expression that is used to match URI strings for which the virtual waiting room feature is enabled.

This parameter is required.'),
  waitUrl?: string(name='WaitUrl', description='The URL of the waiting page.

This parameter is required.', example='https://example.com/waitingroom.html'),
}

model SetWaitingRoomConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model SetWaitingRoomConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetWaitingRoomConfigResponseBody(name='body'),
}

/**
 * @summary Configures the virtual waiting room feature for an accelerated domain name. This operation is available only for accelerated domain names of the Dynamic CDN workload type.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request SetWaitingRoomConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetWaitingRoomConfigResponse
 */
async function setWaitingRoomConfigWithOptions(request: SetWaitingRoomConfigRequest, runtime: $RuntimeOptions): SetWaitingRoomConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.allowPct)) {
    query['AllowPct'] = request.allowPct;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.gapTime)) {
    query['GapTime'] = request.gapTime;
  }
  if (!$isNull(request.maxTimeWait)) {
    query['MaxTimeWait'] = request.maxTimeWait;
  }
  if (!$isNull(request.waitUri)) {
    query['WaitUri'] = request.waitUri;
  }
  if (!$isNull(request.waitUrl)) {
    query['WaitUrl'] = request.waitUrl;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetWaitingRoomConfig',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Configures the virtual waiting room feature for an accelerated domain name. This operation is available only for accelerated domain names of the Dynamic CDN workload type.
 *
 * @description > You can call this operation up to 30 times per second per account.
 *
 * @param request SetWaitingRoomConfigRequest
 * @return SetWaitingRoomConfigResponse
 */
async function setWaitingRoomConfig(request: SetWaitingRoomConfigRequest): SetWaitingRoomConfigResponse {
  var runtime = new $RuntimeOptions{};
  return setWaitingRoomConfigWithOptions(request, runtime);
}

model StartCdnDomainRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model StartCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model StartCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartCdnDomainResponseBody(name='body'),
}

/**
 * @summary Enables a disabled domain name. After the domain name is enabled, the value of the DomainStatus parameter is changed to Online.
 *
 * @description *   If the domain name is in an invalid state or you have an overdue payment in your account, the domain name cannot be enabled.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request StartCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartCdnDomainResponse
 */
async function startCdnDomainWithOptions(request: StartCdnDomainRequest, runtime: $RuntimeOptions): StartCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables a disabled domain name. After the domain name is enabled, the value of the DomainStatus parameter is changed to Online.
 *
 * @description *   If the domain name is in an invalid state or you have an overdue payment in your account, the domain name cannot be enabled.
 * *   You can call this operation up to 100 times per second per account.
 *
 * @param request StartCdnDomainRequest
 * @return StartCdnDomainResponse
 */
async function startCdnDomain(request: StartCdnDomainRequest): StartCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return startCdnDomainWithOptions(request, runtime);
}

model StopCdnDomainRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name that you want to disable. You can specify only one domain name in each request.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model StopCdnDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='16A96B9A-F203-4EC5-8E43-CB92E68F4CD8'),
}

model StopCdnDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopCdnDomainResponseBody(name='body'),
}

/**
 * @summary Disables an accelerated domain name. After the domain name is disabled, the value of the DomainStatus parameter is changed to Offline.
 *
 * @description *   After an accelerated domain is disabled, Alibaba Cloud CDN retains its information and routes all the requests that are destined for the accelerated domain to the origin server.
 * *   You can call this operation up to 40 times per second per account.
 *
 * @param request StopCdnDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopCdnDomainResponse
 */
async function stopCdnDomainWithOptions(request: StopCdnDomainRequest, runtime: $RuntimeOptions): StopCdnDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopCdnDomain',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables an accelerated domain name. After the domain name is disabled, the value of the DomainStatus parameter is changed to Offline.
 *
 * @description *   After an accelerated domain is disabled, Alibaba Cloud CDN retains its information and routes all the requests that are destined for the accelerated domain to the origin server.
 * *   You can call this operation up to 40 times per second per account.
 *
 * @param request StopCdnDomainRequest
 * @return StopCdnDomainResponse
 */
async function stopCdnDomain(request: StopCdnDomainRequest): StopCdnDomainResponse {
  var runtime = new $RuntimeOptions{};
  return stopCdnDomainWithOptions(request, runtime);
}

model TagResourcesRequest {
  resourceId?: [ string ](name='ResourceId', description='The list of resource IDs. Maximum number of list elements: 50.

This parameter is required.', example='1'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Set this value to **DOMAIN**.

This parameter is required.', example='DOMAIN'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of a tag.

This parameter is required.', example='env'),
      value?: string(name='Value', description='The value of a tag.', example='value'),
    }
  ](name='Tag', description='The tags. Maximum number of list elements: 20.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='97C68796-EB7F-4D41-9D5B-12B909D76508'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds one or more tags to specific resources.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds one or more tags to specific resources.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags. Valid values:

*   **true**: yes.
*   **false**: no.

Default value: **false**.', example='false'),
  resourceId?: [ string ](name='ResourceId', description='The list of resource IDs. You can specify up to 50 resource IDs in the list.

This parameter is required.', example='example.com'),
  resourceType?: string(name='ResourceType', description='The type of the resources from which you want to remove tags. Set this parameter to **DOMAIN**.

This parameter is required.', example='DOMAIN'),
  tagKey?: [ string ](name='TagKey', description='The list of tag keys. You can specify up to 20 tag keys in the list.', example='env'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='97C68796-EB7F-4D41-9D5B-12B909D76508'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from specified resources.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes tags from specified resources.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateCdnDeliverTaskRequest {
  deliver?: string(name='Deliver', description='The method that is used to send operations reports. Operations reports are sent to you only by email. The settings must be escaped in JSON.', example='{\\\\\\\\"email\\\\\\\\":{\\\\\\\\"subject\\\\\\\\":\\\\\\\\"The email subject\\\\\\\\",\\\\\\\\"to\\\\\\\\":[\\\\\\\\"songmingyuan@alibaba-inc.com\\\\\\\\",\\\\\\\\"songmingyuan@alibaba-inc.com\\\\\\\\"]}}"'),
  deliverId?: long(name='DeliverId', description='The ID of the tracking task that you want to update.

This parameter is required.', example='3'),
  domainName?: string(name='DomainName', description='The domain name that you want to track. You can specify up to 500 domain names in each request. Separate multiple domain names with commas (,). If you do not specify a domain name, the task collects data from all domain names that belong to your Alibaba Cloud account.', example='www.example.com'),
  name?: string(name='Name', description='The name of the tracking task.', example='Domain name report'),
  reports?: string(name='Reports', description='The operations reports that are tracked by the task. The data must be escaped in JSON.', example='[{\\\\\\\\"reportId\\\\\\\\":1,\\\\\\\\"conditions\\\\\\\\":[{\\\\\\\\"field\\\\\\\\":\\\\\\\\"prov\\\\\\\\",\\\\\\\\"op\\\\\\\\":\\\\\\\\"in\\\\\\\\",\\\\\\\\"value\\\\\\\\":[\\\\\\\\"Heilongjiang\\\\\\\\",\\\\\\\\"Beijing\\\\\\\\"]}]}]'),
  schedule?: string(name='Schedule', description='The parameters that specify the time interval at which the tracking task sends operations reports. The settings must be escaped in JSON.', example='"{\\\\\\\\"schedName\\\\\\\\":\\\\\\\\"The name of the tracking task\\\\\\\\",\\\\\\\\"description\\\\\\\\":\\\\\\\\"The description\\\\\\\\",\\\\\\\\"crontab\\\\\\\\":\\\\\\\\"000\\\\*\\\\*?\\\\\\\\",\\\\\\\\"frequency\\\\\\\\":\\\\\\\\"d\\\\\\\\",\\\\\\\\"status\\\\\\\\":\\\\\\\\"enable\\\\\\\\",\\\\\\\\"effectiveFrom\\\\\\\\":\\\\\\\\"2020-09-17T00:00:00Z\\\\\\\\",\\\\\\\\"effectiveEnd\\\\\\\\":\\\\\\\\"2020-11-17T00:00:00Z\\\\\\\\"}"'),
}

model UpdateCdnDeliverTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateCdnDeliverTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCdnDeliverTaskResponseBody(name='body'),
}

/**
 * @summary Updates a tracking task.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request UpdateCdnDeliverTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCdnDeliverTaskResponse
 */
async function updateCdnDeliverTaskWithOptions(request: UpdateCdnDeliverTaskRequest, runtime: $RuntimeOptions): UpdateCdnDeliverTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.deliver)) {
    body['Deliver'] = request.deliver;
  }
  if (!$isNull(request.deliverId)) {
    body['DeliverId'] = request.deliverId;
  }
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.name)) {
    body['Name'] = request.name;
  }
  if (!$isNull(request.reports)) {
    body['Reports'] = request.reports;
  }
  if (!$isNull(request.schedule)) {
    body['Schedule'] = request.schedule;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCdnDeliverTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates a tracking task.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request UpdateCdnDeliverTaskRequest
 * @return UpdateCdnDeliverTaskResponse
 */
async function updateCdnDeliverTask(request: UpdateCdnDeliverTaskRequest): UpdateCdnDeliverTaskResponse {
  var runtime = new $RuntimeOptions{};
  return updateCdnDeliverTaskWithOptions(request, runtime);
}

model UpdateCdnSubTaskRequest {
  domainName?: string(name='DomainName', description='The domain name that you want to track. You can specify up to 500 domain names in each request. If you specify multiple domain names, separate them with commas (,). If you do not specify a domain name, operations reports are updated for all domain names in your Alibaba Cloud account.', example='www.example.com'),
  endTime?: string(name='EndTime', description='The end time of the operations report. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-11-17T00:00:00Z'),
  reportIds?: string(name='ReportIds', description='The IDs of operations reports that you want to update. Separate IDs with commas (,).', example='1,2,3'),
  startTime?: string(name='StartTime', description='The start time of the operations report. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-09-17T00:00:00Z'),
}

model UpdateCdnSubTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateCdnSubTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCdnSubTaskResponseBody(name='body'),
}

/**
 * @summary Updates one or more operations reports.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request UpdateCdnSubTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCdnSubTaskResponse
 */
async function updateCdnSubTaskWithOptions(request: UpdateCdnSubTaskRequest, runtime: $RuntimeOptions): UpdateCdnSubTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!$isNull(request.reportIds)) {
    body['ReportIds'] = request.reportIds;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCdnSubTask',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates one or more operations reports.
 *
 * @description > You can call this operation up to three times per second per account.
 *
 * @param request UpdateCdnSubTaskRequest
 * @return UpdateCdnSubTaskResponse
 */
async function updateCdnSubTask(request: UpdateCdnSubTaskRequest): UpdateCdnSubTaskResponse {
  var runtime = new $RuntimeOptions{};
  return updateCdnSubTaskWithOptions(request, runtime);
}

model UpdateFCTriggerRequest {
  functionARN?: string(name='FunctionARN', description='The feature trigger.', example='acs:fc:1223455566666:123:services/myservice/functions/myfunction'),
  notes?: string(name='Notes', description='The remarks.', example='test'),
  roleARN?: string(name='RoleARN', description='The assigned RAM role.', example='acs:ram:: 1234567890:role/aliyuncdneventnotificationrole'),
  sourceARN?: string(name='SourceARN', description='The resources and filters for event listening.', example='acs:cdn:*:1234567890:domain/example.com'),
  triggerARN?: string(name='TriggerARN', description='The trigger that corresponds to the Function Compute service.

This parameter is required.', example='acs:fc:cn-beijing: 1234567890:services/FCTestService/functions/printEvent/triggers/testtrigger'),
}

model UpdateFCTriggerResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EC046C5D-8CB4-4B6B-B7F8-B335E51EF90E'),
}

model UpdateFCTriggerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFCTriggerResponseBody(name='body'),
}

/**
 * @summary Updates a specified Function Compute trigger.
 *
 * @param request UpdateFCTriggerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFCTriggerResponse
 */
async function updateFCTriggerWithOptions(request: UpdateFCTriggerRequest, runtime: $RuntimeOptions): UpdateFCTriggerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.triggerARN)) {
    query['TriggerARN'] = request.triggerARN;
  }
  var body : map[string]any = {};
  if (!$isNull(request.functionARN)) {
    body['FunctionARN'] = request.functionARN;
  }
  if (!$isNull(request.notes)) {
    body['Notes'] = request.notes;
  }
  if (!$isNull(request.roleARN)) {
    body['RoleARN'] = request.roleARN;
  }
  if (!$isNull(request.sourceARN)) {
    body['SourceARN'] = request.sourceARN;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateFCTrigger',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates a specified Function Compute trigger.
 *
 * @param request UpdateFCTriggerRequest
 * @return UpdateFCTriggerResponse
 */
async function updateFCTrigger(request: UpdateFCTriggerRequest): UpdateFCTriggerResponse {
  var runtime = new $RuntimeOptions{};
  return updateFCTriggerWithOptions(request, runtime);
}

model VerifyDomainOwnerRequest {
  domainName?: string(name='DomainName', description='The domain name of which you want to verify the ownership. You can specify only one domain name.

This parameter is required.', example='example.com'),
  verifyType?: string(name='VerifyType', description='The verification method. Valid values:

*   **dnsCheck**: by DNS record
*   **fileCheck**: by verification file

This parameter is required.', example='dnsCheck'),
}

model VerifyDomainOwnerResponseBody = {
  content?: string(name='Content', description='The verification result.

> This parameter is returned only if the operation fails.', example='verify_dffeb6610035dcb77b413a59c32c****'),
  requestId?: string(name='RequestId', description='The request ID.', example='34AB41F1-04A5-496F-8C8D-634BDBE6A9FB'),
}

model VerifyDomainOwnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyDomainOwnerResponseBody(name='body'),
}

/**
 * @summary Verifies the ownership of a specified domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request VerifyDomainOwnerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyDomainOwnerResponse
 */
async function verifyDomainOwnerWithOptions(request: VerifyDomainOwnerRequest, runtime: $RuntimeOptions): VerifyDomainOwnerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.verifyType)) {
    query['VerifyType'] = request.verifyType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VerifyDomainOwner',
    version = '2018-05-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Verifies the ownership of a specified domain name.
 *
 * @description > You can call this operation up to 100 times per second per account.
 *
 * @param request VerifyDomainOwnerRequest
 * @return VerifyDomainOwnerResponse
 */
async function verifyDomainOwner(request: VerifyDomainOwnerRequest): VerifyDomainOwnerResponse {
  var runtime = new $RuntimeOptions{};
  return verifyDomainOwnerWithOptions(request, runtime);
}

